Here is what NEC 2011 has to say about replacing receptacles with no equipment ground.
National Electrical Code 2011
250.130 Equipment Grounding Conductor Connections. Equipment grounding conductor connections at the source of separately derived
systems shall be made in accordance with 250.30(A)(1). Equipment
grounding conductor connections at service equipment shall be made as
indicated in 250.130(A) or (B). For replacement of non–grounding-type
receptacles with grounding-type receptacles and for branch-circuit
extensions only in existing installations that do not have an
equipment grounding conductor in the branch circuit, connections shall
be permitted as indicated in 250.130(C).
(C) Nongrounding Receptacle Replacement or Branch Circuit Extensions. The equipment grounding conductor of a grounding-type
receptacle or a branch-circuit extension shall be permitted to be
connected to any of the following:
(1) Any accessible point on the grounding electrode system as described in 250.50
(2) Any accessible point on the grounding electrode conductor
(3) The equipment grounding terminal bar within the enclosure where the branch circuit for the receptacle or branch circuit originates
(4) For grounded systems, the grounded service conductor within the service equipment enclosure.
(5) For ungrounded systems, the grounding terminal bar within the service equipment enclosure
More from the NEC
National Electrical Code 2011
406.4 General Installation Requirements. Receptacle outlets shall be located in branch circuits in accordance with Part III of Article
210. General installation requirements shall be in accordance with 406.4(A) through (F).
(C) Methods of Grounding. The equipment grounding conductor contacts of receptacles and cord connectors shall be grounded by
connection to the equipment grounding conductor of the circuit
supplying the receptacle or cord connector.
(D) Replacements. Replacement of receptacles shall comply with 406.4(D)(1), (D)(2), and (D)(3) as applicable.
(1) Grounding-Type Receptacles. Where a grounding means exists in the receptacle enclosure or an equipment grounding conductor is
installed in accordance with 250.130(C), grounding-type receptacles
shall be used and shall be connected to the equipment grounding
conductor in accordance with 406.4(C) or 250.130(C). \
(2) Non–Grounding-Type Receptacles. Where attachment to an equipment grounding conductor does not exist in the receptacle
enclosure, the installation shall comply with (D)(2)(a), (D)(2)(b), or
(a) A non–grounding-type receptacle(s) shall be permitted to be replaced with another non–grounding-type receptacle( s).
(b) A non–grounding-type receptacle(s) shall be permitted to be replaced with a ground-fault circuit interrupter type of receptacle(s).
These receptacles shall be marked “No Equipment Ground.” An equipment
grounding conductor shall not be connected from the ground-fault
circuit interrupter type receptacle to any outlet supplied from the
ground-fault circuit-interrupter receptacle.
(c) A non–grounding-type receptacle(s) shall be permitted to be replaced with a grounding-type receptacle(s) where supplied through a
ground-fault circuit interrupter. Grounding-type receptacles supplied
through the groundfault circuit interrupter shall be marked “GFCI
Protected” and “No Equipment Ground.” An equipment grounding conductor
shall not be connected between the grounding type receptacles.
(3) Ground-Fault Circuit Interrupters. Ground-fault circuit-interrupter protected receptacles shall be provided where
replacements are made at receptacle outlets that are required to be so
protected elsewhere in this Code.
There's a good YouTube video, where Mike Holt explains the options for Replacing two-wire receptacles
Consult your local government and/or a licensed electrician, to determine which version of code is used in your area. Codes do change, and you'll always have to follow the code adopted in your area.