Sorry, I have no idea about the dlls .. I don't use any dlls at all.
As for your other question, your $com object stays open until you comclose it (or you close mIRC). This means that if you're going to be hitting the database with any regularity whatsoever, it's best to leave it open until you don't need it anymore, then close it (and any other objects you've created that use it). If you wanted to, you could open the connection on START and close it on EXIT. Creating the objects and getting everything connected is fairly slow, whereas using them once they are open/connected is not anywhere near as slow.