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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server does not exist or access denied

Status
Not open for further replies.

dpdoug

Programmer
Nov 27, 2002
455
US
I'm a newbie to .NET. I've been trying out these sample apps that use MSDE or SQL Server and I keep getting this error message. I have MSDE installed on my machine and also the Northwind database. What could be the problem?


SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 229: ' Create and Fill a new DataSet.
Line 230: Dim ds As New DataSet()
Line 231: sda.Fill(ds)
Line 232:
Line 233: Return ds

Thanks again for all you invaluable help and tips!

dpd
 
When you are creating a SqlConnection object, you must be supplying a Connection String. Make sure that it's right.

If your MSDE is configured for Windows Integrated Security (default), try this:

Code:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=localhost

If you are using Sql Server security, something like this:
Code:
Provider=SQLOLEDB.1;Password=MyPassword;Persist Security Info=True;User ID=MyUserName;Initial Catalog=Northwind;Data Source=localhost

In either case, unless the user is an administrator, you will need to add the user to Northwind's list of Users. If you are using Integrated Windows Security, the user name will be ASPNET. Or, more specifically, MACHINENAME\ASPNET, where MACHINENAME is the name of your computer.

HTH,

David
[pipe]
 
With sql server, you also have to add the aspnet user to the list of users, and grant permissions to the database objects the aspnet user should have access to specifically.

D'Arcy
 
Excuse my ignorance, but how do you add to the list of users in SQL? I've been looking for the place to do this but I can't find it.

dpdoug
 
When you expand your database tree, you should see one of the items under it say Users (or Logins...I think its Users though). You just have to right-click and select 'Add a User...', and the dialog box will take you from there.
:)

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top