简体   繁体   English

经典ASP-哪些用户需要授予存储过程的执行权限

[英]Classic ASP - Which user needs execute permissions granted for stored procedure

I have a classic ASP application running under IIS (v8.5.9600) on Windows Server 2012R2. 我有一个经典的ASP应用程序,在Windows Server 2012R2的IIS(v8.5.9600)下运行。 One of the pages makes use of a file upload control that allows a user to upload a data file to be processed by the system. 页面之一利用文件上载控件,该控件允许用户上载要由系统处理的数据文件。 Once the file is uploaded a stored procedure is executed that takes the name of the file uploaded and inserts it into a table. 上传文件后,将执行存储过程,该过程将使用上传文件的名称并将其插入表中。

Some of my users have been receiving an error message after uploading the file. 我的一些用户在上传文件后一直收到错误消息。 Checking the IIS log I see the error is the following ... 检查IIS日志,我看到以下错误...

244|80040e09|[Microsoft][ODBC_SQL_Server_Driver][SQL_Server]The_EXECUTE_permission_was_denied_on_the_object_'myStoredProcedureName'__database_'myDatabaseName'__schema_'dbo'.,

From reading other articles it seems as though I need to grant execute permissions to this specific stored procedure. 通过阅读其他文章 ,似乎我需要授予对该特定存储过程的执行权限。 My question is this .. 我的问题是这个..

  1. Which user needs the execute permissions? 哪个用户需要执行权限? Is it the user that the database connection specifies or is it the user that the website runs under via IIS? 是数据库连接指定的用户还是通过IIS运行网站的用户?
  2. This error does not occur with most users. 大多数用户不会发生此错误。 It only seems to be occurring with a few of the users that upload files. 似乎只有少数几个上载文件的用户才发生这种情况。 If the issue were permissions shouldn't it be occurring with all users? 如果问题是权限,不是所有用户都应该发生吗?

webworm - many thanks. webworm-非常感谢。

The execute permission needs to be given to the user in the connection string. 需要在连接字符串中向用户授予执行权限。

The user manipulating the database is the one that is mentioned in the connection string. 操作数据库的用户是连接字符串中提到的用户。 It is possible to use multiple connection strings, of course, for different parts on the application, linking to many different databases, though this can become a nightmare to manage. 当然,可以为应用程序的不同部分使用多个连接字符串,链接到许多不同的数据库,尽管这可能成为管理的噩梦。 I recommend creating all of the connection strings in the global.asa and limiting the SQL user accounts to as few as possible. 我建议在global.asa创建所有连接字符串,并将SQL用户帐户限制为尽可能少。 It's easier to give the same account access to multiple databases on the same server... 授予相同帐户访问同一服务器上多个数据库的权限更加容易...

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM