This happened rather unexpectedly (in that it had worked, then stopped) on my wife's '96. It would connect to a hand held OBD2 scanner with no problem, but the state computer couldn't.
I got a wiring diagram for the plug, and started checking what I could. I found that there are two pins that are supposed to be grounded, and only one was. I probably should have traced that wire that wasn't grounded (but should have been) to see why, but we were in a bit of a time crunch (plates were expiring) so I just clipped it and grounded it behind the dash, near the plug. Took it back to the state, computer hooked up fine and it passed.