SQL Server Authentication issues!


T

Tony

Hi all!

I am having a rather odd issue with VB.Net (Visual Studio 2005) and SQL
Server 2005. I developed a little app for our team but then decided to
make it available for others. Since out team was given admin rights to
our database, I used integrated security for the first version of the
app. When I opened it up to other groups, I changed to SQL
authentication.

The problem is that no one outside our group has been able to use the
app because of DB connection issues. It always works from my machine,
so I checked the activity monitor on the server. Sure enough, I am
logged in as myself instead of the user I set up for the application.

Here is the connection string:

Private m_SQLConStr As String = "Data Source=MYDB;Initial
Catalog=MYDATA;Integrated Security=False;Persist Security
Info=False;User ID=MYUSER;Password=MYPASSWORD"

Does anyone have any insight into this problem?

Thanks!
 
Ad

Advertisements

A

aaron.kempf

2 choices:

a) move to mySql; where username/password security is secure. MS SQL
Authentication is _IMPOSSIBLE_ to secure
b) enable double-hop authenticaiton for SQL Server; setspn and 'trust
for delegation'

-Aaron
 
P

Plamen Ratchev

Hi,

Can you modify your connection string to look like this and see if it works:

Private m_SQLConStr As String = "Data Source=MYDB;Initial
Catalog=MYDATA;User Id=MYUSER;Password=MYPASSWORD;"

You can also try:

Private m_SQLConStr As String = "Server=MYDB;Database=MYDATA;User
ID=MYUSER;Password=MYPASSWORD;Trusted_Connection=False;"

Regards,

Plamen Ratchev
http://www.SQLStudio.com
 
T

Tony

Hi!

I have added the trusted source section to the string so it looks like
the following:

"Data Source=MYDB;Initial Catalog=MYDATA;Integrated
Security=False;Persist Security Info=False;User
ID=MYUSER;Password=MYPASSWORD;Trusted_Connection=False;"

It is STILL connecting as my login. This is very irritating. Does
anyone have any more suggestions?


Plamen said:
Hi,

Can you modify your connection string to look like this and see if it works:

Private m_SQLConStr As String = "Data Source=MYDB;Initial
Catalog=MYDATA;User Id=MYUSER;Password=MYPASSWORD;"

You can also try:

Private m_SQLConStr As String = "Server=MYDB;Database=MYDATA;User
ID=MYUSER;Password=MYPASSWORD;Trusted_Connection=False;"

Regards,

Plamen Ratchev
http://www.SQLStudio.com

Thanks,
Tony
 
A

aaron.kempf

I dont think that you need the integrated_security = false

screw this whole thread

a) make a new text file
b) rename it to test.udl
c) double click on it.. setup connection.. hit apply / ok -- however
you want to do it.
d) rename it from text.udl to test.txt
e) open it with notepad and you've got a REAL CONNECTION STRING


-Aaron
 
Ad

Advertisements

T

Tony

Hey! Neat trick! It didn't directly solve my problem, but it did throw
an error which helped me diagnose the issue. It seems that the admin
had only set the database to allow integrated security connections. I
guess that my attempts to log in as a specific user failed, and the
system just used a trusted connection instead. I hate it when computers
try to be helpful.

Thanks everyone!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top