|
-
Apr 16th, 2005, 11:36 AM
#1
Thread Starter
Member
Unable To Connect To MS SQL Server 2000
Hi,
I can't seem to connect to my database.
Can someone please kindly help me out? Thanks alot...
Dim sqlConn As SqlConnection = New SqlConnection
Dim connStr As String = "Server=Lex;Database=xxxDB;Trusted_Connection=True;"
I'm not very sure about the server name part, how can I check it out? Or is there any problems with the connection string? Because I get the following error:
Login failed for user 'LEX\ASPNET'.
______________________________________
Warmest Regards,
Lex
______________________________________
:|: Don't Mess With The Predator :|:
-
Apr 16th, 2005, 11:43 AM
#2
Re: Unable To Connect To MS SQL Server 2000
ASP.Net is attempting to connect to your database using the ASP.Net user (usually IUSR_MachineName) - you'll need to add that user to SQL (and your database) to fix this error. Alternatively, you can use a specific user instead of integrated authentication.
-
Apr 16th, 2005, 11:54 AM
#3
Re: Unable To Connect To MS SQL Server 2000
We do two-tier systems for local area networks - so I've got no experience with ASP...
But axion_sa - how is logging in with a default user a secure method? On the other hand how is specifying the username and password in the connection secure?
Just wondering - since I don't work in this realm.
-
Apr 16th, 2005, 12:28 PM
#4
Re: Unable To Connect To MS SQL Server 2000
 Originally Posted by szlamany
We do two-tier systems for local area networks - so I've got no experience with ASP...
But axion_sa - how is logging in with a default user a secure method? On the other hand how is specifying the username and password in the connection secure?
Just wondering - since I don't work in this realm.
The IUSR_MachineName user is created by ASP.Net on installation and is a local user that has highly limited rights on the local machine. There isn't much one may do with that user (e.g. access folders or files outside the ASP.Net domain) should one hack the account. That being said, it isn't at all easy to brute-force the ASP.Net account password - standing under correction here, but I believe the password is about 150 characters in length, randomly chosen by ASP.Net itself. So, all in all, using the ASP.Net account is not a problem at all. One may change that (for example in the <processModel> sections in web.config or machine.config) or change by changing the account running IIS (or the application pool on Windows 2003)).
With regards to using a specific SQL user - the security is relative. If you use limited access credentials (i.e. not "sa") with access to only that database, limited execution/read rights on SQL, security breaches won't that large. However, if one does use sa or other highly privileged user, the implications...
-
Apr 16th, 2005, 12:30 PM
#5
Re: Unable To Connect To MS SQL Server 2000
Thanks for the info - never know when I might be asked an ASP question or expected to do something in that area!
-
Apr 17th, 2005, 07:36 AM
#6
Thread Starter
Member
Re: Unable To Connect To MS SQL Server 2000
Hi,
I still don't really understand what you people are trying to convey. Can someone simplify this for me? Also, I've added a specific user to the database using Enterprise Manager.
I don't really know what's wrong... -.-"
______________________________________
Warmest Regards,
Lex
______________________________________
:|: Don't Mess With The Predator :|:
-
Apr 17th, 2005, 11:15 AM
#7
Re: Unable To Connect To MS SQL Server 2000
 Originally Posted by Lex@SG
Also, I've added a specific user to the database using Enterprise Manager.
By this I assume you mean you've created a new user and are talking about SQL Server authentication. For such a case, change your connection string to:
"Server=SERVERNAME;Database=pubs;User ID=newuser;Password=asdasd;Trusted_Connection=False"
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
|