WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADO DAO
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Close an Active Connection

 Keywords: ADO Close Connection Activeconnection nothing

Question:

RSO = ObjectCreate("ADODB.Recordset")

... lots of code...

RSO.ActiveConnection = ""
The last line causes an ole error. It seems that the last line should work, that is be the equivalent of the VB "nothing", i.e. RSO.ActiveConnection = Nothing

Answer:

Try the following
RSO.ActiveConnection = ObjectType("DISPATCH", 0)
It's much closer to VB's implementation of the 'nothing' keyword in this context than an empty string. You can assign just about anything to a WIL variable holding a reference to an object to release the reference. However, 'ActiveConnection' is not a WIL reference variable - it is an object property.

User Reply:

Worked!
Article ID:   W17439
File Created: 2008:04:10:15:10:26
Last Updated: 2008:04:10:15:10:26