Hi there
I get the above message when trying to write to a SQL 2000 database. Can
anyone perhpas shed some light on this for me?
In theory I am tryng to create a generic subroutine which I can simply pass
my INSERT/UPDATE/DELETE statements to, and then have it executed. The
following subroutine gets called for each server that I am running through.
The error above is returned on the line "objRecordSet2.Close"
My code excerpt is as follows:
Sub AccessDB()
' Set the database connection information
sServer = "test"
sLogin = "logon"
sPwd = "pwd"
' Create the ADO Connection and Recordset objects.
Set objConnection2 = CreateObject( "ADODB.Connection" )
Set objRecordSet2 = CreateObject( "ADODB.Recordset" )
' Set the connection string, open the connection and execute the statement
objConnection2.ConnectionString = "PROVIDER=SQLOLEDB" & _
";SERVER=" & sServer & _
";UID=" & sLogin & _
";PWD=" & sPwd & _
";DATABASE=ServerSupport"
WScript.Echo & SQLString
objConnection2.open
objRecordSet2.Open SQLString, objConnection2
objRecordSet2.Close
objConnection2.Close
End Sub