A 97 Explorer will be an OBD-II vehicle. Unfortunately, the 4wd problem is not an OBD-monitored device. Trouble codes for the 4wd system are stored in the GEM, and scanning them reauires an NGS or WDS scanner (or equivalent). The cheapest one I've seen was an AutoTap scan system for a laptop, and it was $700. (last I heard they were no longer being sold)
Sorry to be the bearer of bad news...