Click to See Complete Forum and Search --> : SQL Server does not exist or access denied


nswan
January 3rd, 2003, 01:05 PM
Hi when i try to run the following code:

Dim objConnection As New SqlClient.SqlConnection("server=.;database=KeepFit;trusted_connection=true")
Dim objCommand As New SqlClient.SqlCommand("Select * from Members", objConnection)
Dim objReader As SqlClient.SqlDataReader


'open our database connection
objConnection.Open()


i get the error-

"SQL Server does not exist or access denied."

I then changed the server to "server=LAPTOP1-NICK\NETSDK" and i get-

"Login failed for user 'LAPTOP1-NICK\ASPNET'"

Anybody know how to solve this?

Help I am going out of my mind!!!

sager
January 15th, 2003, 09:02 PM
Where is this sql server located? is it local? have you set up a login on the SQL server that matches the profile you are logged into on the machine you are trying to access the server from. It is probably not a good idea to use trusted connections unless you are the only one using the site.

mwilliamson
January 16th, 2003, 01:48 PM
You should change the . to (local), but either way, using a trusted connection means you are using the account your are logged onto windows as. All ASP.NET applications "log on as" the ASPNET user. You have to give ASPNET permission on your SQL Server.