Briefly put, don't do it! Do not substitute an AC adapter for battery power in products made for babies and small children. There is a serious safety issue here -- if the adapter malfunctions or shorts out, the baby could be injured or killed. There is a limit to how badly awry something can go with just four D-cell batteries, but there is almost no limit when something is plugged into a wall outlet.
You may want to substitute an AC adapter for batteries in another appliation, though. Some adapters have lots of options for different plugs which can be put on either way (I have just such an adapter I got at a popular electronics supply store). One way to find out is to read the manual carefully. Another is to check it with a voltmeter.
If you donít have the manual or a voltmeter, you can still check it with a battery and a flashlight bulb. By wiring the battery, the AC adapter, and a flashlight bulb (one from a 6V flashlight should do fine for the 6V adapter) in series, you can tell if youíve got the + and -ís lined up (donít wire them in parallel -- youíll short the battery out and could be injured by battery chemicals).
If the adapter is 6V and your battery is 1.5V, then the light bulb will glow visibly brighter with 7.5 V on it (the batteryís + wired to the AC adapterís - or vice versa) than the 4.5 V youíll get if you wire it up the other way so the voltages subtract (the batteryís + attached to the AC adapterís +, for example).
(republished on 07/22/06)