我们正在将经典的asp应用程序从server 2003迁移到服务器2008r2。我们的应用程序使用以32位模式运行的经典ASP前端连接到VB com DLL。我能够让大多数东西运行,包括连接到数据库。我遇到的问题是运行存储过程,当我调用调用存储过程的DLL中的函数时,我收到错误800a01a8对象所需的错误。我可以看到通过SQL Server探查器调用存储过程并锁定数据库。我可以调用直接选择/插入语句的函数,它们工作正常。我可以通过查询分析器使用相同的参数运行存储过程。
有什么想法吗?
asp调用response.write Dll.callfunction
VB 6 Dll函数
Dim cmdStoredProc As ADODB.Command
Dim TheRS As ADODB.Recordset
Dim strGo As String
Dim strOptionLine As String
Dim objObjectContext As ObjectContext
Dim objResponse As Response
Dim strCurrentID As String
If Not Conn_Good Then Exit Sub
strGo = GetDisplayedText(257, ClassLng, O)
Disconnect 1
If Conn_Good Then
Set cmdStoredProc = New ADODB.Command
Set cmdStoredProc.ActiveConnection = conn
cmdStoredProc.CommandType = adCmdStoredProc
cmdStoredProc.CommandText = "MYTABLESTOREDPROC"
cmdStoredProc.Parameters.Refresh
cmdStoredProc.Parameters(1).Value = GUID
Set TheRS = New ADODB.Recordset
TheRS.LockType = adLockReadOnly
TheRS.CursorType = adOpenForwardOnly
TheRS.CursorLocation = adUseClient
TheRS.Open cmdStoredProc
If Err.Number <> 0 Then
O.RaiseErrVB Err.Number, "PromptChangeNAme", "Muser", Err.Description, "MYTABLESTOREDPROC", ""
TheRS.Close
Set TheRS = Nothing
Set cmdStoredProc = Nothing
Disconnect (2)
Else
Set objObjectContext = GetObjectContext()
Set objResponse = objObjectContext.item("Response")
' Begin Form and Select
objResponse.Write "<form method=""POST"" action="""" name=""ChangeName""><select name=""frmName"" size=1>"
strCurrentID = ID
Do While TheRS.EOF = False
If strCurrentID = TheRS.Fields("ID") Then
strOptionLine = "<OPTION selected VALUE=" & TheRS.Fields("ID") & ">" & TheRS("NAME") & "</Option>"
Else
strOptionLine = "<OPTION VALUE=" & TheRS.Fields("ID") & ">" & TheRS.Fields("NAME") & "</Option>"
End If
TheRS.MoveNext
objResponse.Write strOptionLine
Loop
TheRS.Close
Set TheRS = Nothing
Set cmdStoredProc = Nothing
Disconnect (1)
End If
End If
Err.Clear
On Error GoTo 0
objResponse.Write "</select><br><p><input TYPE=""SUBMIT"" Value=""" & strGo & """ name=""GoSearch""></form>" & vbCrLf
Set objResponse = Nothing
Set objObjectContext = Nothing