简体   繁体   English

SQL Server在ASP经典版[Microsoft]中执行SQL存储过程时出错[SQL Server Native Client 11.0] [SQL Server]错误

[英]SQL Server Error executing SQL stored procedure in ASP classic [Microsoft][SQL Server Native Client 11.0][SQL Server] Error

Please see the SQL server error messages I am getting when executing a SQL Server stored procedure from ASP classic. 从ASP classic执行SQL Server存储过程时,请参阅我收到的SQL Server错误消息。

I am using two session variables as parameters for the stored procedure. 我正在使用两个会话变量作为存储过程的参数。

I had no issues with this, until just recently I started getting the following error, the errors are different between production and test servers. 我对此没有任何问题,直到最近我才开始遇到以下错误,生产服务器和测试服务器之间的错误有所不同。

Why is the Session variable appended to the error description, what does it mean? 为什么将Session变量附加到错误描述中,这是什么意思?

Please see the code below and the errors. 请查看下面的代码和错误。

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

I am getting the following error, note there is the Session variable (strStudentID) at the end of the error description. 我收到以下错误,请注意在错误说明的末尾有Session变量(strStudentID)。

This error I get on the production server 我在生产服务器上遇到此错误

The Error Number is: -2147217911 错误号是:-2147217911
The Description given is: [Microsoft][SQL Server Native Client 11.0][SQL Server]915111111 给出的描述是:[Microsoft] [SQL Server Native Client 11.0] [SQL Server] 915111111

This error is on the non-production server. 此错误在非生产服务器上。

The Error Number is: -2147217911 错误号是:-2147217911
The Description given is: [Microsoft][ODBC SQL Server Driver][SQL Server]915111111 给出的说明是:[Microsoft] [ODBC SQL Server驱动程序] [SQL Server] 915111111

Well judging by the error 根据错误判断

The error code refers to -2147217911 which is; 错误代码是指-2147217911,即;

[Microsoft][ODBC SQL Server Driver][SQL Server]SELECT permission denied on object 'Table_Name', database 'Database_Name', owner 'dbo'. [Microsoft] [ODBC SQL Server驱动程序] [SQL Server]对对象“表名称”,数据库“数据库名称”,所有者“ dbo”的选择权限被拒绝。

On Microsoft Support Site there's is some more detail; 在Microsoft支持站点上,有更多详细信息;

From Microsoft Support - KB963994 来自Microsoft支持-KB963994
The user's database login has not been granted the db_datareader role for the database. 用户的数据库登录名尚未被授予数据库的db_datareader角色。

So you need to GRANT permission to the login you are using to call the Stored Procedure or one of the tables inside it, either way we'd need more information. 所以,你需要GRANT允许您使用调用存储过程或它里面的一个表,无论哪种方式,我们需要更多的信息登录。 For whatever reason your descriptions returned are pretty meaningless. 无论出于何种原因,您返回的描述都毫无意义。


Based on feedback 根据反馈

I have no idea why the Session values are appended to the half completed error output, perhaps something else is getting added to the output in the Stored Procedure? 我不知道为什么将Session值附加到半完成的错误输出中,也许其他内容正在添加到存储过程的输出中? Could be rogue PRINT statement for example. 例如,可能是流氓PRINT语句。

Ideally we would need to see the Stored Procedure definition to rule that out. 理想情况下,我们需要查看“存储过程”定义才能将其排除。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误= [Microsoft] [SQL Server本机客户端11.0] - Error = [Microsoft][SQL Server Native Client 11.0] 经典ASP Microsoft SQL Server本机客户端11.0错误&#39;80040e14&#39;用户登录失败,但不是我指定的用户登录 - Classic ASP Microsoft SQL Server Native Client 11.0 error '80040e14' Login failed for user, but not the one I specified 适用于ASP Classic的SQL Server存储过程 - SQL Server stored procedure for ASP classic Microsoft SQL Server本机客户端11.0:无法打开数据库 - Microsoft SQL Server Native Client 11.0 : Cannot open database 存储过程SQL SERVER中的错误 - Error in stored procedure SQL SERVER 在SQL Server上执行存储过程 - Executing a stored procedure on SQL server 在SQL Server中执行存储过程? - Executing a stored procedure in SQL Server? 无法运行查询:SQLSTATE [42000]:[Microsoft] [SQL Server Native Client 11.0] [SQL Server]&#39;)&#39;附近的语法不正确 - Failed to run query: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ')' [Microsoft] [SQL Server本机客户端11.0] SQL Server网络接口:连接字符串无效 - [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Connection string is not valid odbc调用失败[microsoft] [sql server本机客户端11.0] [sql server]多部分标识符盘绕不绑定 - odbc call failed [microsoft] [sql server native client 11.0] [sql server] the multipart identifier coild not be bound
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM