请参阅从ASP经典执行SQL Server存储过程时遇到的SQL Server错误消息。在ASP经典中执行SQL存储过程的SQL Server错误[Microsoft] [SQL Server Native Client 11.0] [SQL Server]错误
我正在使用两个会话变量作为存储过程的参数。
我对此没有任何问题,直到最近我开始出现以下错误,生产和测试服务器之间的错误不同。
为什么会将Session变量追加到错误描述中,这是什么意思?
请参阅下面的代码和错误。
Dim strStudentID
Dim transactionId
strStudentID = Session("ix_National_ID")
transactionId = Session("transactionId")
Session("accesslevel") = ""
session("SessionStatus") = "5"
Set cmd = server.createobject("ADODB.command")
With cmd
.ActiveConnection = con
.CommandType = adCmdStoredProc
.CommandText = "Temple_sp_Application_Insert"
.Parameters.Append cmd.CreateParameter("@TUID ", adVarchar, adParamInput, 200, strStudentID)
.Parameters.Append cmd.CreateParameter("@transactionId ", adVarchar, adParamInput, 200, transactionId)
.Execute
if Err.Number <> 0 then
Response.Write "An Error Has Occurred on this page!<BR>"
Response.Write "The Error Number is: " & Err.number & "<BR>"
Response.Write "The Description given is: " & Err.Description & "<BR>"
end if
End With
Set cmd = Nothing
Set Con = Nothing
con.Close
我收到以下错误,请注意存在错误描述末尾的会话变量(strStudentID)。
这个错误我得到的生产服务器上
错误号:-2147217911
给出的描述是:[微软] [SQL Server本机客户端11.0] [SQL服务器] 915111111
此错误位于非生产服务器上。
错误号:-2147217911
给出的描述是:[微软] [ODBC SQL Server驱动程序] [SQL服务器] 915111111
@marc_s我使用的代码块的格式,因为它是从脚本输出,否则会使用块引用。 – Lankymart
相关[A:在经典ASP中执行SQL存储过程](http://stackoverflow.com/a/39905617/692942)。 – Lankymart