Hello guys/girls
The instruction at "0x7c910a19" referenced memory at "oxffffffff". The memory could not be "read"
I have a small issue, I receive the error above before the .vbs terminates. I don't know why this error is thrown. Below is the process of the .vbs file:
Call ImportTransactions()
Call UpdateTransactions()
Function ImportTransactions()
Dim objConnection, objCommand, objRecordset, strOracle
Dim strSQL, objRecordsetInsert
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "DSN=*****;UID=*****;PWD==*****;"
Set objCommand = CreateObject("ADODB.Command")
Set objRecordset = CreateObject("ADODB.Recordset")
strOracle = "SELECT query here from Oracle database"
objCommand.CommandText = strOracle
objCommand.CommandType = 1
objCommand.CommandTimeout = 0
Set objCommand.ActiveConnection = objConnection
objRecordset.cursorType = 0
objRecordset.cursorlocation = 3
objRecordset.Open objCommand, , 1, 3
If objRecordset.EOF = False Then
Do Until objRecordset.EOF = True
strSQL = "INSERT query here into SQL database"
strSQL = Query(strSQL)
Call RunSQL(strSQL, objRecordsetInsert, False, conTimeOut, conServer, conDatabase, conUsername, conPassword)
objRecordset.MoveNext
Loop
End If
objRecordset.Close()
Set objRecordset = Nothing
Set objRecordsetInsert = Nothing
End Function
Function UpdateTransactions()
Dim strSQLUpdateVAT, strSQLUpdateCodes
Dim objRecordsetVAT, objRecordsetUpdateCodes
strSQLUpdateVAT = "UPDATE query here SET [value:costing output] = ([value:costing output] * -1)"
Call RunSQL(strSQLUpdateVAT, objRecordsetVAT, False, conTimeOut, conServer, conDatabase, conUsername, conPassword)
strSQLUpdateCodes = "UPDATE query here SET [value:costing output] = ([value:costing output] * -1) different WHERE clause"
Call RunSQL(strSQLUpdateCodes, objRecordsetUpdateCodes, False, conTimeOut, conServer, conDatabase, conUsername, conPassword)
Set objRecordsetVAT = Nothing
Set objRecordsetUpdateCodes = Nothing
End Function
UDPATE: If I exit the function after I open the connection (see below) it still causes the same error.
Function ImportTransactions()
Dim objConnection, objCommand, objRecordset, strOracle
Dim strSQL, objRecordsetInsert
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "DSN=*****;UID=*****;PWD==*****;"
Set objCommand = CreateObject("ADODB.Command")
Set objRecordset = CreateObject("ADODB.Recordset")
Exit Function
End Function
It does both the import and update and seems to throw this error after.
Thanks in advance for any help,
Clare