473,802 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User permission problems. sqlconnection

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.Sql Client.SqlConne ction = New SqlConnection(" Data
Source=spdb01;I nitial Catalog=SToP;In tegrated 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.

May 3 '06 #1
15 1954
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.goo glegroups.com.. .
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.Sql Client.SqlConne ction = New SqlConnection(" Data
Source=spdb01;I nitial Catalog=SToP;In tegrated 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.

May 3 '06 #2
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.
"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
May 4 '06 #3
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,

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.
"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

May 4 '06 #4
And you have to make for every user his own connectionstrin g

Cor

"Göran Andersson" <gu***@guffa.co m> schreef in bericht
news:uT******** ******@TK2MSFTN GP02.phx.gbl...
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,

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.
"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


May 4 '06 #5
Thanks for the replies guys. I'll clarify my issue a little more.
All users in my domain are members of the "Domain Users", I've even
tried adding the specific user I'm testing with as db_owner of the
database, still nothing happens. When a non-admin user gets to the
line where I declare the SQLConnection, it just seems to stop, and then
the program starts eating up memory (using Task Manager) like crazy. I
let it run once until it used up over 200mb, normally the program only
uses 20mb. The program doesn't error out at all, and I've got that
line encased in a "Try, Catch" statement.

May 4 '06 #6
I also just tried passing a username and password to the database. The
admin users are still working, but the others are not. It seems that
the non-admin users don't have permissions to run "Sqlconnection" , it
doesn't seem to be a database security problem, but a system security
problem somewhere.

May 4 '06 #7
Also, it works fine for any user on a Windows XP and 2000 workstation,
but not for a regular user on a Windows 2000 Terminal Server.

May 4 '06 #8
No, just one connection string! Everyone logs under the same SQL account

Jeff

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:uK******** ******@TK2MSFTN GP02.phx.gbl...
And you have to make for every user his own connectionstrin g

Cor

"Göran Andersson" <gu***@guffa.co m> schreef in bericht
news:uT******** ******@TK2MSFTN GP02.phx.gbl...
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,

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.

"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

May 4 '06 #9
What do you mean "not a database security problem"? Of course it is!

I'm surprised you aren't reading what you are writing. Did you see my first
reply? You've set up the admins as users in the database. That means NO ONE
ELSE can access it!

And that is exactly what you are seeing.

And did you even try my suggestion? Don't use Windows Security. Create a
single SQL user account, and put that in the (single) connection string. I
used to work in the SQL Server group at Microsoft, and wrote a book about
it. Trust me.

If you really need Windows Security, follow these steps:

* Ideally, put all the users you need to have access into a company global
domain group. You might have to ask your IT dept for this.

* Otherwise, create a local group on the SQL box. Then add your users to
this group.

* Then create a SQL login for this group, and give access to the appropriate
database.

However, if you don't need this much security, create a single SQL account
(not a Windows account), and use that single account, and pass the username
and password on the connection string. You may need to go through SQL Server
setup to tell it to use BOTH SQL and Windows authentication

Jeff
"sflynn" <ss*****@gmail. com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
I also just tried passing a username and password to the database. The
admin users are still working, but the others are not. It seems that
the non-admin users don't have permissions to run "Sqlconnection" , it
doesn't seem to be a database security problem, but a system security
problem somewhere.

May 4 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1734
by: Nayt Grochowski | last post by:
Does anyone see any problem with the loading a SqlConnection into the System.Web.HttpContextCurrent.Items collection in a Page's Constructor. Then Closing and Disposing of it the OnUnload method? Connection would not be "Opened" until it was actually used (this is handled by a common "Helper" class - similar to Microsoft's SqlHelper Application Block), Ie: public class MyPage : Page { public MyPage() {
2
4378
by: RF | last post by:
Hi, I have an app that I need to set some values in the CurrentUser and LocalMachine of the Registry. If the user has administrator previledges, no problems occur. However, if the user if of type "limited" or non-administrator, I receive an exception when trying to write in the LocalMachine. How can I bypass or impersonate the administrator to enable the app to write values in the LocalMachine.
1
3396
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is comprised of a DataGrid may have separate permissions for adding, deleting and updating a news item. Problem Up until now, I have been implementing security directly inside the control. I will test directly against the security model to see if...
5
2065
by: Norsoft | last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a dll which inherits from System.Windows.Forms.UserControl. It works fine on a PC with only the 1.1 Framework. However, the control will not load on a PC with the 2.0 Framework installed. I know that IE will use the newest framework so I assume it is a security issue. At the assembly level I apply the following attributes;
6
2443
by: Andrew Chalk | last post by:
My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI"); myConnection.Open(); However, the user of this database is ASPNET. I can't create a user ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name...
4
3541
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
1
650
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
5
4099
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
1
7521
by: goc | last post by:
I have a Web Farm, that fetches its database-data from a separate database-server. Today I was forced to go over to .NET 2.0 (since 1.1 can't be installed on Windows Vista x64), and it brought about quite alot of problems. But now I've sorted out everything except one problem that I just can't get to disappear: As soon as I try to connect to a database from my code and run a query, I get an exception thrown: Check: Request for the...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4274
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.