Unable to connect to database???

jace314

Member
Joined
Nov 2, 2005
Messages
17
Location
CT
Programming Experience
Beginner
Hello all,
Need a little help. Im using vb.net 2003, Im pretty new to it so I bought a really good book to help me along. I have Access, and MS SQL on my local PC. In vb.net I have a new project open, and I click on Sever Explorer and click the new connection button. Then I proceed to fill in the correct info, whether MS SQL or Access. I click the test button and it says that its successful! Then I click OK, and I get an error stating:

Server Explorer
Unable to connect to database, please check username and password and try again.

I have verified all the setting numerous times, and it always says the same thing. Just in case, Im using Win XP, service pack 2!

Thanks Ahead!
 
to add a server that way, i think your database needs to be either "mixed mode" or "windows authenticated."

Which basically boils down to, did you add your windows login as a user in MS SQL?

domain\username
 
I added the password in mixed mode. I also have no problem using the MS SQL web administrator to view the databases. Using the password I created. Its just confusing being its the same error using SQL or Access. And why would the test connection be successful?
Thanks
 
If the SQL instance is running on a local machine, you aren't allowed to connect with a different login/password using server explorer. In SQL Server, under users, you need to add your local windows login (or relate it to an alias).
 
Yes its running on my local PC. So your saying I cant use the SA username, and the password i created for it? I have to use windows login, not the SQL login? How do I change the login to windows?
Any reason why its the same error with Access?
Thanks Again
 
correct

You can 'associate' your login to sa, but thats deffinitely not recommended (I always honeypot the sa, make it a seemingly impossible password and then dumb it down to nothing and never use it, if you ever get breached; that's the first thing someone's going to go for).

Add a new user to your system
Under Login name, select <new>
Next to the "Name:" textbox there a "..." box, click it
In the dropdown, find your local computer (it should have an asterisk)
In the Listbox, find the user you use and add it
Set all your priviledges and which db's

I'm not completely sure why it's the same as your access error. If the access db is local and not password protected; you should be able to pop right in it. Make sure its the mdb you're connecting to and you should be golden.
 
Okay, Im a bit confused, sorry! Are you talking about a new windows account? I use MS SQL Desktop, so if thats what your refering to Im not sure where to start to add a new user. When I installed SQL I had to do that run command C:\whatever\sapwd = "Whatever". Then I use web admin thing to add databases and tables! When I log in I use SQL login not windows, since I setup the SA and password as mixed, I guess?
I checked the Access issue to. I selected the jet thing for mdb, theres no password protection at all. Yet its the same error. Is there anything in windows XP that could be causing this issue?
Thanks for all the help!
 
Im using VB.Net 2003, standard! Basically no matter what I do with any database's I always get the same Server Explorer error: Unable to connect please check user and pass and try again. But everytime I use the test Connection button, it says successful??
 
ok :)

So far my advice will help you a little less than not at all. I assumed you had the full version. Someone else is going to have to help you with this one. I've only used the full version, sorry. :(
 
Back
Top