We encountered a problem this week with VBScript. For some reason we couldn’t get ADO to begin a new transaction (BeginTrans()) using our global database function. After some twiddling we found the reason.
We had used this code:
c_db = null
all functions are using ByRef input arguments.
Because we set c_db to null, it had no memory reference and thus we had no object to update in the global DB functions.
So to work, we had to use this:
set c_db = server.createObject("ADODB.Connection")
We wanted the DBStart to handle the initialization of the ADO objects.