|
-
Sep 11th, 2003, 11:57 AM
#1
Thread Starter
New Member
I cant connect to Sql Server...
Im learning ASP.net and I have the MSDE (stripped down version of SQL server) installed on my computer. I worte a simple 1 page asp. net project and when I try to connect to the database I fail.
Here is the error message...
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 48: 'open the database connection and put results into the data reader
Line 49: '----------------------------------------------------------------------
Line 50: objConnection.Open()
Line 51: objReader = objCommand.ExecuteReader
Line 52: '----------------------------------------------------------------------
Now....
The server does exists and there should be no need for a uid or psw.
here is my connection string
Dim objConnection As New SqlClient.SqlConnection("server=.;database=KeepFit;trusted_connection=true")
Any help, I have been stuck for 2 days now.
Last edited by Roto23; Sep 11th, 2003 at 12:02 PM.
-Roto-
-
Sep 11th, 2003, 12:05 PM
#2
PowerPoster
It's because you are connecting via annonymous acces, therfore, you need to grant db access to the asp.net account in sql server.
-
Sep 11th, 2003, 12:06 PM
#3
Thread Starter
New Member
<<It's because you are connecting via annonymous acces, therfore, you need to grant db access to the asp.net account in sql server.>>
How do I do this?
-
Sep 11th, 2003, 12:13 PM
#4
PowerPoster
Open Enterprise Manager
---->Open the Security Folder
-------->Right click Logins (New Login)
-------------->Click the ... button
------------------>Select the aspnet account
Then, open your database, right click users (new user), then add the same user and give him the appropriate rights.
-
Sep 11th, 2003, 12:31 PM
#5
PowerPoster
I don't think that MSDE comes with an enterprise manager though. There are some free substitutes out there I believe though.
-
Sep 11th, 2003, 12:34 PM
#6
PowerPoster
You're right, I just skimmed the post.
-
Sep 11th, 2003, 02:01 PM
#7
Thread Starter
New Member
Man, I added ASPNET to the Public group and gave the Public group select/delete/and more...it still failed, with the same error.
Any other suggestions? Or should I just move on, I mean how important is it to connect to a database :-)
-
Sep 11th, 2003, 02:40 PM
#8
The first thing that jumped at me was the server name.... try localhost or "(local)" instead...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|