mIRC Homepage
Posted By: Bilge /comclose doesn't free up the com object file. - 22/11/03 02:27 AM
/comclose closes the connection to the COM object, but the file which exports that COM object progid remains locked. I presume that mIRC has locked the file, although it might be MSDTC... however closing mIRC unclocks the file. The big problem here is that mIRC has to be closed every time I need to recompile, and it would also mean that for each upgrade version that is released, users would have to close mIRC to upgrade.

/comclose means that mIRC is finished with this COM object, so there is no reason to lock the source file. If it really is mIRC's fault, then this should definitely be rectified.
I believe your problem is related to what I've encountered. This VBScript creates an Access 97 MDB file
  • Set a = CreateObject("ADOX.Catalog")
    a.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;Jet OLEDB:Engine Type=4;"
    Set a = Nothing
The "Create" method makes a locked "test.mdb" file, that becomes unlocked once the object is released. After the code runs, you can do whatever you want with the newely created "test.mdb".

I "converted" this code to a mIRC script...
  • .comopen a ADOX.Catalog
    !.echo -q $com(a,Create,3,bstr,Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;Jet OLEDB:Engine Type=4;)
    .comclose a
and surprisingly, "test.mdb" is still locked after the script finishes, and can't be removed until mIRC is restarted.

Maybe /comclose is broken.
An interesting observation. Thanks for confirming this problem. I hope it is acknowledged in an update for the next version.
© mIRC Discussion Forums