【发布时间】:2016-11-22 17:54:18
【问题描述】:
请查看从 ASP 经典执行 SQL Server 存储过程时收到的 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
我收到以下错误,请注意错误描述末尾有 Session 变量 (strStudentID)。
我在生产服务器上遇到这个错误
错误号是:-2147217911
给出的描述是:[Microsoft][SQL Server Native Client 11.0][SQL Server]915111111
此错误出现在非生产服务器上。
错误号是:-2147217911
给出的描述是:[Microsoft][ODBC SQL Server Driver][SQL Server]915111111
【问题讨论】:
-
@marc_s 我使用代码块进行格式化,因为它是脚本的输出,否则会使用块引用。
标签: sql sql-server sql-server-2012 asp-classic