So you find yourself in a place (maybe a new apartment?) with apparently no Ground in the electrical outlets. This is probably because they are all 2-prong outlets, or maybe you've used an outlet checker and it says the Ground is no good. What can you do? By far the best solution technically is to re-wire the building, but let's look for the less expensive, more practical things if you are not the owner planning major home upgrades.
You have several issues to deal with here, starting from the apparent situation that there is no reliable Ground anywhere. A Ground is used for two purposes: part of a protection system for wiring or circuit faults that mistakenly send real power to the computer's chassis that is accessible to people; and removing static charges and electrical signal noise while they are at low levels, before they build up to troublesome.
1. Assume you have no Ground anywhere. Even if there are a few three-prong outlets in walls, they MAY have been especially installed properly, but quite possibly not. It's an old and BAD habit to replace a two-prong outlet on an ungrounded system with a three-prong one just to allow using that kind of plug, but NOT actually provide any Ground connection! So unless you can verify that the 3-prong one is done correctly, assume it is not. (See item 5 below for tests you can do with a volt / ohm meter.)
2. Here is how 110 VAC house wiring in Canada and USA (and others) is supposed to be set up. It's based on what is called a Grounded Neutral system. Both at the transformer out on the power pole, and at the fuse or breaker box in the house, the Neutral line is connected to a true Ground to the earth. So at those two points the Neutral line is at zero volts potential compared to the earth. Anywhere else in the house the Neutral line is NOT guaranteed to be the same as ground. It is carrying current supplied to the user's device (a computer or a tea kettle) back to the Neutral bus in the fuse box. Since the wiring in the wall has a very small but non-zero resistance, there actually is a small voltage present at the wall outlet on the Neutral line, compared to true Ground.
3. At the house fuse box or breaker panel there is a true Ground connection to the panel box itself. As I said, that also is connected to the Neutral bus in the box. In modern designs there is a separate Ground bus in the box, and all wiring running out to circuits everywhere in the house is done with cable containing two current-carrying conductors (insulated) plus one bare copper wire for Ground. This is how Ground is provided at every outlet box in the house. And in all of these, NOTHING (except a Ground lead) should be connected to that Ground, so it never carries any current under normal circumstances. In older systems there was no Ground lead extending beyond the main fuse box, and no Ground bus in the box. In a few older systems, though you may find a circuit has been added on later using what is called "BX cable". This is the wiring with a spiral metal covering on the outside. Normally the clamps used to anchor the cable to the fuse box and to the outlet box in the room manage to establish an electrical connection between the fuse box itself and the outlet box. In that case, because the fuse box itself is supposed to be grounded, the outlet box will be, too.
4. Today's design with 3-prong outlets etc. has a cable coming into a box in the wall with three wires. (The wire is labeled something like 14/2, indicating that it has 14-gauge wire in it and has two current-carrying insulated wires, PLUS a bare Ground wire). The color code is: Black for Hot (the "supply" of power), White for Neutral (for returning current) and bare for Ground. When a 3-prong outlet is mounted in the wall box so that, of the triangle of slots and a hole, the round hole is at the bottom pointing down, then the round (bottom) one is Ground, the left one with the wider slot is Neutral, and the right one is Hot. That way you cannot plug even a 2-prong proper "Polarized" plug in wrong, because the wider (Neutral) blade won't fit into the narrow (Hot) slot. In older non-grounded systems, there is no Ground, but there still are Hot and Neutral. However, often these sockets were made with no difference in slot widths, and there was no standardization on whether Hot was left or right.
5. In a modern system if you use a neon tester you will find 110 VAC from Hot (right) to Neutral (left), and also 110 VAC from Hot to Ground, but no apparent voltage from Neutral to Ground. That is because the tester cannot show you very small voltages between Neutral and Ground. In an older ungrounded system, you'll still detect 110 VAC from Hot to Neutral, but there appears to be no voltage from either of those slots to the metal box in the wall. That is because the metal box is not connected to anything! There is no Ground available at the box. If you have a decent multi-use electrical meter with AC Volts and Resistance ranges, you can do three other tests. The first is simply to repeat those neon tester ones, setting the meter range to measure more than 120 VAC (say, 0-200). Note the readings - they should look like either 110 to 120 VAC, or no volts. Now the second tests: for only the ones that appear to be zero volts (like Left (Neutral) to Ground), try setting the voltmeter to even lower ranges, like 0-5 VAC or 0-1 VAC. IF you also have a heavier load connected to the circuit (say, a teakettle plugged into the other half of the outlet) you may see small fluctuating voltages there. However, if you are testing an old system with no Ground in the box, you probably will still see no voltage just because the box is NOT connected to Ground or anything else. Now the third test is for Continuity or Resistance. You ONLY do this on places where your previous test says there is no measurable voltage present, so maybe the two test points are actually connected together somewhere. You set the meter to read Ohms Resistance and apply the probes to the two test points. If they are connected, you should read only a very few ohms, and you may find the reading depends on how hard you push the probes to make contact with the metal. If you think the place you are trying to test really is a Ground and want to verify that (for example, the metal box mounted in the wall, or the Ground (round) hole in an outlet), you need a known true Ground for reference. Try hooking up a long piece of wire to a water pipe or, even better, to the real Ground terminal where your fuse box is connected to a water pipe near it. Now measure the resistance from your test point to true Ground. It really should be no more than a few ohms, often less than one ohm and hard to measure.
6. Now to start on solutions, other than moving or persuading the landlord to re-wire the place. For the purposes of getting rid of low-level voltages, either static charges or electrical noise signals, you can try to connect a separate (green) wire from the computer outside case to a reliable Ground. Best place to look is a water pipe. Water supply systems run a pipe though a lot of soil, thus providing good electrical contact to the earth. Older systems are ALL metal piping, so it works. However, some have been modified with plastic piping components in odd places, so it is always possible that a water tap may NOT be a reliable Ground, and it is nearly impossible for an amateur to tell. But that's still your best bet. (See item 5 above on how to test and verify whether a possible Ground point near your computer really is Grounded to the earth.)
7. The other function of a good Ground is in electrical supply system safety. One way a Grounded system protects you is that any part of your appliance that is exposed to people should be connected to true Ground. Then if anything goes wrong in the appliance and the Hot supply comes into contact with that exterior, the Ground lead does two things. The most important is that it provides a high-current-capacity route for the power to be taken to Ground - so high that the current will exceed the limit of the fuse or Breaker in the panel that supplies the Hot lead, and it will blow out. That stops the current. The second is that, during the very short time all that takes, the exterior case you can touch will be VERY close to zero volts anyway, so you are unlikely to be shocked. Now, if you install a green grounding wire to a nearby water tap, it may or may not be able to carry all that current and provide the protection a real Ground system can - it depends on how good the substitute ground connection is. But it should be able to handle the small currents from electrical noise and static charges IF it is actually connected to the earth.
8. An alternative to a true Ground system for safety is a Ground Fault Circuit Interrupter (GFCI). You can actually buy the simpler one-circuit version of these at any electrical supplies or hardware shop. They look a lot like a normal 3-prong double outlet (but more expensive) and you mount them into the wall box in place of the old outlet device. (Obviously, before starting you MUST isolate power from the box before opening, by removing the fuse or shutting off the breaker that supplies this outlet box.) They are different on the front in that they also have a little indicator light, a TEST button, and a RESET button. If you don't understand house wiring you are best advised to have this item installed by someone who does, like an electrician. (If you are competent at home electrical systems, see end of this paragraph.) Once properly installed, what they do is to constantly measure and compare the currents flowing in both the Hot and Neutral parts of the circuit. Those ALWAYS should match. If they don't the GFCI interprets that to mean some current is leaking out of the circuit to somewhere else, and that could be a big problem. So it shuts off the power or "trips out", just like a circuit breaker does. Once you fix the original problem, you use the Reset button. You can test at any time with the Test button, and it will trip out for you. The intriguing part is that this device does not need a true Ground point to operate, so it can work in an ungrounded outlet box. It just uses a different measurement to decide when to shut off power. So it provides very similar safety protection for people and for many appliance malfunctions, but it does nothing for getting rid of electrical noise and static charges. Now, for those competent to install a GFCI, here are notes to use; all others skip down. READ the GFCI unit's manual; it usually has four terminals or wire leads. Three of these are the usual Hot (Black), Neutral (White) and Ground (Green or bare copper). These are the supply connections to the double outlet. The fourth (often Red) is an OUTPUT of sorts. It is a Hot connection on the Load side of the device (just like the small right-hand slots) that you can use to power additional outlet boxes further down the circuit layout. If there's a cable leaving this box to power other boxes, use this "Output" Red as the Hot supply going out on that cable. Then ALL the outlet boxes "downstream" from this box also are protected by the GFCI, but NOT any boxes that came before it. For that reason, if you plan on using the GFCI for this multi-outlet box protection system, the device should be mounted in the very first box in the chain - the one fed directly from the Fuse Box or Breaker Panel.
So, a combination of a GFCI for safety protection against malfunctions, and a ground wire from the computer's case to a water line for removing static charges and electrical noise, may work for you. These still do nothing for power system surges, but a modern grounded system does not, either. That's a whole separate issue.
You have several issues to deal with here, starting from the apparent situation that there is no reliable Ground anywhere. A Ground is used for two purposes: part of a protection system for wiring or circuit faults that mistakenly send real power to the computer's chassis that is accessible to people; and removing static charges and electrical signal noise while they are at low levels, before they build up to troublesome.
1. Assume you have no Ground anywhere. Even if there are a few three-prong outlets in walls, they MAY have been especially installed properly, but quite possibly not. It's an old and BAD habit to replace a two-prong outlet on an ungrounded system with a three-prong one just to allow using that kind of plug, but NOT actually provide any Ground connection! So unless you can verify that the 3-prong one is done correctly, assume it is not. (See item 5 below for tests you can do with a volt / ohm meter.)
2. Here is how 110 VAC house wiring in Canada and USA (and others) is supposed to be set up. It's based on what is called a Grounded Neutral system. Both at the transformer out on the power pole, and at the fuse or breaker box in the house, the Neutral line is connected to a true Ground to the earth. So at those two points the Neutral line is at zero volts potential compared to the earth. Anywhere else in the house the Neutral line is NOT guaranteed to be the same as ground. It is carrying current supplied to the user's device (a computer or a tea kettle) back to the Neutral bus in the fuse box. Since the wiring in the wall has a very small but non-zero resistance, there actually is a small voltage present at the wall outlet on the Neutral line, compared to true Ground.
3. At the house fuse box or breaker panel there is a true Ground connection to the panel box itself. As I said, that also is connected to the Neutral bus in the box. In modern designs there is a separate Ground bus in the box, and all wiring running out to circuits everywhere in the house is done with cable containing two current-carrying conductors (insulated) plus one bare copper wire for Ground. This is how Ground is provided at every outlet box in the house. And in all of these, NOTHING (except a Ground lead) should be connected to that Ground, so it never carries any current under normal circumstances. In older systems there was no Ground lead extending beyond the main fuse box, and no Ground bus in the box. In a few older systems, though you may find a circuit has been added on later using what is called "BX cable". This is the wiring with a spiral metal covering on the outside. Normally the clamps used to anchor the cable to the fuse box and to the outlet box in the room manage to establish an electrical connection between the fuse box itself and the outlet box. In that case, because the fuse box itself is supposed to be grounded, the outlet box will be, too.
4. Today's design with 3-prong outlets etc. has a cable coming into a box in the wall with three wires. (The wire is labeled something like 14/2, indicating that it has 14-gauge wire in it and has two current-carrying insulated wires, PLUS a bare Ground wire). The color code is: Black for Hot (the "supply" of power), White for Neutral (for returning current) and bare for Ground. When a 3-prong outlet is mounted in the wall box so that, of the triangle of slots and a hole, the round hole is at the bottom pointing down, then the round (bottom) one is Ground, the left one with the wider slot is Neutral, and the right one is Hot. That way you cannot plug even a 2-prong proper "Polarized" plug in wrong, because the wider (Neutral) blade won't fit into the narrow (Hot) slot. In older non-grounded systems, there is no Ground, but there still are Hot and Neutral. However, often these sockets were made with no difference in slot widths, and there was no standardization on whether Hot was left or right.
5. In a modern system if you use a neon tester you will find 110 VAC from Hot (right) to Neutral (left), and also 110 VAC from Hot to Ground, but no apparent voltage from Neutral to Ground. That is because the tester cannot show you very small voltages between Neutral and Ground. In an older ungrounded system, you'll still detect 110 VAC from Hot to Neutral, but there appears to be no voltage from either of those slots to the metal box in the wall. That is because the metal box is not connected to anything! There is no Ground available at the box. If you have a decent multi-use electrical meter with AC Volts and Resistance ranges, you can do three other tests. The first is simply to repeat those neon tester ones, setting the meter range to measure more than 120 VAC (say, 0-200). Note the readings - they should look like either 110 to 120 VAC, or no volts. Now the second tests: for only the ones that appear to be zero volts (like Left (Neutral) to Ground), try setting the voltmeter to even lower ranges, like 0-5 VAC or 0-1 VAC. IF you also have a heavier load connected to the circuit (say, a teakettle plugged into the other half of the outlet) you may see small fluctuating voltages there. However, if you are testing an old system with no Ground in the box, you probably will still see no voltage just because the box is NOT connected to Ground or anything else. Now the third test is for Continuity or Resistance. You ONLY do this on places where your previous test says there is no measurable voltage present, so maybe the two test points are actually connected together somewhere. You set the meter to read Ohms Resistance and apply the probes to the two test points. If they are connected, you should read only a very few ohms, and you may find the reading depends on how hard you push the probes to make contact with the metal. If you think the place you are trying to test really is a Ground and want to verify that (for example, the metal box mounted in the wall, or the Ground (round) hole in an outlet), you need a known true Ground for reference. Try hooking up a long piece of wire to a water pipe or, even better, to the real Ground terminal where your fuse box is connected to a water pipe near it. Now measure the resistance from your test point to true Ground. It really should be no more than a few ohms, often less than one ohm and hard to measure.
6. Now to start on solutions, other than moving or persuading the landlord to re-wire the place. For the purposes of getting rid of low-level voltages, either static charges or electrical noise signals, you can try to connect a separate (green) wire from the computer outside case to a reliable Ground. Best place to look is a water pipe. Water supply systems run a pipe though a lot of soil, thus providing good electrical contact to the earth. Older systems are ALL metal piping, so it works. However, some have been modified with plastic piping components in odd places, so it is always possible that a water tap may NOT be a reliable Ground, and it is nearly impossible for an amateur to tell. But that's still your best bet. (See item 5 above on how to test and verify whether a possible Ground point near your computer really is Grounded to the earth.)
7. The other function of a good Ground is in electrical supply system safety. One way a Grounded system protects you is that any part of your appliance that is exposed to people should be connected to true Ground. Then if anything goes wrong in the appliance and the Hot supply comes into contact with that exterior, the Ground lead does two things. The most important is that it provides a high-current-capacity route for the power to be taken to Ground - so high that the current will exceed the limit of the fuse or Breaker in the panel that supplies the Hot lead, and it will blow out. That stops the current. The second is that, during the very short time all that takes, the exterior case you can touch will be VERY close to zero volts anyway, so you are unlikely to be shocked. Now, if you install a green grounding wire to a nearby water tap, it may or may not be able to carry all that current and provide the protection a real Ground system can - it depends on how good the substitute ground connection is. But it should be able to handle the small currents from electrical noise and static charges IF it is actually connected to the earth.
8. An alternative to a true Ground system for safety is a Ground Fault Circuit Interrupter (GFCI). You can actually buy the simpler one-circuit version of these at any electrical supplies or hardware shop. They look a lot like a normal 3-prong double outlet (but more expensive) and you mount them into the wall box in place of the old outlet device. (Obviously, before starting you MUST isolate power from the box before opening, by removing the fuse or shutting off the breaker that supplies this outlet box.) They are different on the front in that they also have a little indicator light, a TEST button, and a RESET button. If you don't understand house wiring you are best advised to have this item installed by someone who does, like an electrician. (If you are competent at home electrical systems, see end of this paragraph.) Once properly installed, what they do is to constantly measure and compare the currents flowing in both the Hot and Neutral parts of the circuit. Those ALWAYS should match. If they don't the GFCI interprets that to mean some current is leaking out of the circuit to somewhere else, and that could be a big problem. So it shuts off the power or "trips out", just like a circuit breaker does. Once you fix the original problem, you use the Reset button. You can test at any time with the Test button, and it will trip out for you. The intriguing part is that this device does not need a true Ground point to operate, so it can work in an ungrounded outlet box. It just uses a different measurement to decide when to shut off power. So it provides very similar safety protection for people and for many appliance malfunctions, but it does nothing for getting rid of electrical noise and static charges. Now, for those competent to install a GFCI, here are notes to use; all others skip down. READ the GFCI unit's manual; it usually has four terminals or wire leads. Three of these are the usual Hot (Black), Neutral (White) and Ground (Green or bare copper). These are the supply connections to the double outlet. The fourth (often Red) is an OUTPUT of sorts. It is a Hot connection on the Load side of the device (just like the small right-hand slots) that you can use to power additional outlet boxes further down the circuit layout. If there's a cable leaving this box to power other boxes, use this "Output" Red as the Hot supply going out on that cable. Then ALL the outlet boxes "downstream" from this box also are protected by the GFCI, but NOT any boxes that came before it. For that reason, if you plan on using the GFCI for this multi-outlet box protection system, the device should be mounted in the very first box in the chain - the one fed directly from the Fuse Box or Breaker Panel.
So, a combination of a GFCI for safety protection against malfunctions, and a ground wire from the computer's case to a water line for removing static charges and electrical noise, may work for you. These still do nothing for power system surges, but a modern grounded system does not, either. That's a whole separate issue.