Radio Shack sells a 12-volt to universal DC adapter. You can adjust a switch that lets you pick between 3, 4.5, 6, and 9 volt output.
If the compass doesn't have a plug for external power, you can usually wire in the adapter into the battery compartment. Most batteries are run in serial, meaning there is a lead from the positive pole of battery #1 that goes into the device, Negative pole #1 touches positive of #2, negative of #2 touches positve of #3 and then the negative pole of battery #3 goes into the device. (Hopefully that's clear - Batteries go in line, + to -). It might not exactly look like that's how it works, but if you look at how the metal contacts work in the battery compartment, that's usually what happens.
If you can figure out which lead is positive and negative from the adapter, you can cut the wire and manually solder/wrap the leads to the right spots on the device to "fake out" a series of batteries. Works like a champ..
If you're hesitant to cut the power lead of the adapter and hard-wire that in, you can always get a female plug from Radio Shack that matches the male output of the adapter. Wire up some eletrical wire (speaker wire is usually fine) to that female plug and voila - Instant bare wires without cutting the original apart.
- G