Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Account Authentication 1

Status
Not open for further replies.

UncleCake

Technical User
Feb 4, 2002
355
US
I am not real familiar with security, so I wondered if anyone could help. I have SQL server set up that allows authentication of Windows users only. I need to connect to the database to do transactions (update, insert, delete) using a connection string and VB.net.

Can I get authenticated using any type of Windows login? I changed it to SQL Server and Windows, made a user and it works, but I don't think that I want to enable SQL Server and Windows authentication. Is this valid and does it make the database less secure?

This is similar to my connection string.
Code:
MyConnection = New System.Data.SQLClient.SqlConnection("server=xx; initial catalog=xx;uid=xx;pwd=xx")

-UnlceCake
 
James,

I think that, that is what I am looking for, but I couldn't get it to work. This is the error I received:

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.SqlClient.dll

Additional information: SqlException

This is the connection that I used:

Code:
MyConnection = New System.Data.SQLClient.SqlCon
nection("server=xx;initial catalog=xx;Integrated Security=SSPI")

Do you see anything wrong with this?

-Uncle Cake
 
From that link:

Code:
"Data Source=myserver;Initial Catalog=mydatabase;Integrated Security=SSPI"

--James
 
James,

I tried it exactly like the page you referenced and I received the same error. I am not sure what the problem is, so I will have to look into more as I pull my hair out. I know that the rest of the code is correct because it works when I designate a user name a pwd.

Thanks for your help,
-Uncle Cake
 
Does the current logged in user have permissions to access SQL Server?
If Query Analyzer is installed on this client machine, can you log in to the server using that?

--James
 
James,

That trigged some thinking on my part, which is probably the problem. I am trying to access the data using a wireless scanner, which has a MAC address. I think that the problem is that is is not being authenticated because of that. I guess I just have to use SQL Server authentication because of that, but I don't know.

-Uncle Cake
 
To use Windows authentication you need to have logged on to the client with a valid windows user account and that account has to have been granted permissions to access SQL Server.

If this is not the case then you will need to use SQL authentication.

--James
 
Thanks James, I appreciate your help!

-Uncle Cake
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top