0

我总是收到错误 3704。关闭对象时不允许操作。

Dim myConnection2, RSTitleList2        

Set myConnection2 = CreateObject("ADODB.Connection")
Set RSTitleList2 = CreateObject("ADODB.Recordset") 

myConnection2.Open "<%=connectionString%>"
sSQL1 = "Update FileInformation SET Status = 4 Where DataDefinitionID = 147 AND CustomerID = 71"
RSTitleList2.open sSQL1, myConnection2


if RSTitleList2.BOF and RSTitleList2.EOF then
    msgbox("INSERT SUCCESSFUL")
    frmProcess.cmdPublish.disabled = true

Else
    msgbox("Not SUCCESSFUL")
    msgbox(err.Number & " | " & err.description & " | " & err.Source)
End IF  

msgbox(err.Number & " | " & err.description & " | " & err.Source)
4

1 回答 1

1

如果您向我们提供错误消息附带的行号所在的行,将会有所帮助。但是我可以在您的代码中看到一件相当奇怪的事情

myConnection2.Open "<%=connectionString%>"

为什么 <%= %> 里面有“connectionstring”。当您想在 html 中显示 asp 变量时使用该语法,例如

<h1>Welcome, <%= username %></h1>

当您已经在一段 asp 代码中时,请尝试

myConnection2.Open connectionString
于 2013-10-23T21:11:47.883 回答