“0x7c910a19”处的指令;引用的内存位于“oxffffffff”。无法“读取”内存

发布于 2024-10-10 16:07:48 字数 2040 浏览 5 评论 0原文

我有一个小问题,在 .vbs 终止之前收到以下错误。我不知道为什么会抛出这个错误。以下是 .vbs 文件的过程:

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

它执行导入和更新,并且似乎在之后抛出此错误。如果我注释掉 ImportTransactions 它不会引发错误,但是我已经为另一个 vbs 文件生成了类似的代码,并且这不会引发任何错误

提前感谢您的任何帮助,

克莱尔

I have a small issue, I receive the following error 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

It does both the import and update and seems to throw this error after. If I comment out the ImportTransactions it doesnt throw a error, however I have produced similar code for another vbs file and this does not throw any errors

Thanks in advance for any help,

Clare

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文