MAP Sensor on 1997 Honda Accord

I unpluged the MAP sensor to clean the idle air control valve (which I realize is unnecessary) it turned out that I didn't have the right size socket so I didn't actually do any work to my car at all. So I shut the hood and started the car so I could go get the right size socket but when I started the car the check engine light was on and the car was running very poorly. It only took me a few seconds to realize I forgot to connect the MAP sensor. So I opened the hood and pluged it back in but it didn't solve the problem, My car ended up dieing, after 15 minutes it finally started back up but now it idles very low just under 500 rpm and it acts like it is going to stall on me but it has only done that one time. It drives fine but when I come to a stop the rpm's drop below 500 and it comes very close to stalling. The car ran fine before the MAP sensor was disconnected. I took it to the auto parts store for a diagonistic test and the error code read that it was the MAP sensor. Bought a new map sensor but that didn't help. The car is still doing the same thing and the check engine light is still on.

Asked by for the 1997 Honda Accord
You didn't need a map sensor , you needed to have the code cleared with a scanner and then do an 'idle learn' which is simply starting the car , with ALL accessories off and let it idle for ten minutes. It will idle erratically until it re-learns conditions.
I'll do that. Of course the guys at the auto parts store wouldn't tell me that, they just wanted to sell me a $70 MAP sensor. Fortunately I didn't get one from them, I went on EBAY and got it for $15 so I am not out too much money. Thanks for your help.
let me know the results.
Yep, that did it. Thanks again for your help.
You're welcome , and thanks for actually replying(most don't)!
Hey, I've got another issue with the car I am hoping you can help me out with. After I cleared the code and did the "idle learn" the car ran great for a few days then the check engine light came back on and it idles very low now and acts like it wants to stall on me. Even though it has yet to actually stall on me it comes very close to stalling all the time.