用户权限问题。的SqlConnection [英] User permission problems. sqlconnection

查看:58
本文介绍了用户权限问题。的SqlConnection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Visual Studio 2005中创建了一个新程序,Visual Basic。

只要
$ b我可以发布,安装和运行程序就好了$ b用户是域管理员的成员。组。我的问题是当使用

非管理员尝试运行该程序时。该程序挂起了

以下行


Dim cn As System.Data.SqlClient.SqlConnection = New SqlConnection(" Data

Source = spdb01; Initial Catalog = SToP; Integrated Security = True;")


我该如何解决这个问题,或者问题是什么。我一直在拉我的头发

。我确定它不是SQL服务器上的权限,

我已经提供了域用户权限。组完全控制数据库。

I''ve just created a new program in Visual Studio 2005, Visual Basic.
I can publish, install, and run the program just fine as long as the
user is a member of the "Domain Admins" group. My problem is when a
non-admin using tries to run the program. The program gets hung up on
the following line

Dim cn As System.Data.SqlClient.SqlConnection = New SqlConnection("Data
Source=spdb01;Initial Catalog=SToP;Integrated Security=True;")

How can I fix this, or what is the problem. I''ve been pulling my hair
out over this. I''m sure it''s not the permissions on the SQL server,
I''ve givin the "Domain Users" group full control of the database.

推荐答案

你说我已经提供了域用户。组完全控制数据库


然后


我的问题是当非管理员尝试运行程序时。


丁丁?显然,非管理员用户无法连接到数据库。添加




您需要SQL上的集成安全性的任何原因吗?您可以在连接字符串中传递

用户名/密码

http://www.connectionstrings.com


杰夫


" sflynn" < SS ***** @ gmail.com>在留言中写道

news:11 ********************** @ u72g2000cwu.googlegr oups.com ...
You said "I''ve givin the "Domain Users" group full control of the database"

then

"My problem is when a non-admin using tries to run the program. "

Ding ding? Non-admin users can''t connect to the database, obviously. Add
them.

Any reason you need Integrated Security on SQL? You could pass a
username/password in the connection string instead

http://www.connectionstrings.com

Jeff

"sflynn" <ss*****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
我刚刚在Visual Studio 2005中创建了一个新程序,Visual Basic。
只要
用户是其成员,我就可以发布,安装和运行程序。 域管理员组。我的问题是当使用
非管理员尝试运行该程序时。该程序挂起了以下几行

Dim cn As System.Data.SqlClient.SqlConnection = New SqlConnection(" Data
Source = spdb01; Initial Catalog = SToP ;集成安全性=真;

如何解决这个问题,或者问题是什么。我一直在拉着我的头发。我确定它不是SQL服务器上的权限,我已经提供了域用户权限。小组完全控制数据库。
I''ve just created a new program in Visual Studio 2005, Visual Basic.
I can publish, install, and run the program just fine as long as the
user is a member of the "Domain Admins" group. My problem is when a
non-admin using tries to run the program. The program gets hung up on
the following line

Dim cn As System.Data.SqlClient.SqlConnection = New SqlConnection("Data
Source=spdb01;Initial Catalog=SToP;Integrated Security=True;")

How can I fix this, or what is the problem. I''ve been pulling my hair
out over this. I''m sure it''s not the permissions on the SQL server,
I''ve givin the "Domain Users" group full control of the database.



杰夫,


我的想法是你的第一个解决方案,如果用户没有权限,

比在连接字符串中添加用户名/密码还要好

sense。
Jeff,

In my idea is your first solution enough, if the user has no permissions,
than adding the username/password in the connection string has as well not
sense.
我的问题是当非管理员尝试运行程序时。 丁丁?显然,非管理员用户无法连接到数据库。添加


您需要SQL上的集成安全性的任何理由?您可以在连接字符串中传递
用户名/密码
"My problem is when a non-admin using tries to run the program. "

Ding ding? Non-admin users can''t connect to the database, obviously. Add
them.

Any reason you need Integrated Security on SQL? You could pass a
username/password in the connection string instead




Cor



Cor


我相信Jeff意味着数据库用户帐户比可信连接更容易处理
。只需在数据库中添加用户

并在连接字符串中提供凭据。然后你没有

来授予很多Windows用户帐户访问数据库的权限。


这也使得更容易收紧安全性。用户帐户可以获得单个数据库的许可,并且只允许执行

存储过程。这样可以使连接完全安全,防止SQL注入(除非存储过程动态创建SQL

)。


Cor Ligthert [MVP]写道:
I believe that Jeff means that a database user account would be easier
to handle than a trusted connection. Just add the user in the datbase
and supply the credentials in the connection string. Then you don''t have
to grant access for a lot of windows user accounts to the database.

That also makes it easier to tighten the security. The user account can
be given permission to a single database, and only permission to execute
stored procedures. That would make the connection totally safe against
SQL injections (unless of course a stored procedure creates SQL
dynamically).

Cor Ligthert [MVP] wrote:
Jeff,

我的想法是你的第一个解决方案,如果用户没有权限,
比添加用户名/连接字符串中的密码也没有意义。
Jeff,

In my idea is your first solution enough, if the user has no permissions,
than adding the username/password in the connection string has as well not
sense.
"我的问题是当非管理员尝试运行程序时。 丁丁?显然,非管理员用户无法连接到数据库。添加


您需要SQL上的集成安全性的任何理由?您可以在连接字符串中传递
用户名/密码
"My problem is when a non-admin using tries to run the program. "

Ding ding? Non-admin users can''t connect to the database, obviously. Add
them.

Any reason you need Integrated Security on SQL? You could pass a
username/password in the connection string instead





Cor



这篇关于用户权限问题。的SqlConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆