Visual studio denying access to database in Server Explorer

M

Mike Malter

Visual Studio is giving me errors when trying to connect to a database server on my
LAN. This has been working for years. Then this morning when I opened VS I went to
the server explorer before opening a project and tried to access a database and got
an error: Invalid User Name or Password. Enter a valid user name and password.

I closed VS down and opened it again and opened a solution. Same error. I then
deleted the connection from the list and tried to reestablish it. I got a message
telling me that I was already connected to the database and wanted to know if I
wanted to disconnect and then reconnect. I answered yes. Then I got a message
telling me it could not disconnect from the server that the connection was still
active. When I clicked ok, I got another error message: Could not reconnect to
"{0}". If your machine is already connected to that server, disconnect and then try
again.

I can go to data connections and establish a connection to that server. I can
connect to it from SQL Server Enterprise manager too. I don't know what to do, I
really want access to that server via the Server Explorer as it is easier for me to
edit stored procedures.

Any suggestions as to what I can do to get this back?

Thanks.
 
K

Kevin Yu [MSFT]

Hi Mike,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're trying to connect to a
database using Server Explorer, an error which says invalid username and
password was shown. If there is any misunderstanding, please feel free to
let me know.

This is very weird that since you can connect to the database using
Enterprise manager, but cannot using the server explorer. Here is my
suggestion:

1. Restart the machine to make sure that all the connections from this
computer to the database are disconnected.
2. Start VisualStudio .NET, but don't open any solutions.
3. Open Server Explorer and delete the original database connection.
4. Try to recreate the connection to see if it works.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
M

Mike Malter

Kevin,

You understand the issue correctly as I documented it exactly.

I did what you suggested, and I am getting the same errors.

What next?

Thanks,

Mike
 
K

Kevin Yu [MSFT]

Hi Mike,

Could you let me know if you have installed something new on the machine
before this happens?

Since the Server Explorer is using ADO to connect to the SQL server, I
think re-installing MDAC on the machine will be helpful. You can download
from the following link if you haven't had windows xp sp2 installed:

http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-
b037-185d0506396c&DisplayLang=en

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
M

Mike Malter

Kevin,

I did not install anything new on the machine. I am extremely picky about what I put
on my development machine - I consider it a production machine actually. All that
happened was that one day it was working, and then next day, I experienced the
behavior I documented for you.

Are you really certain that reinstalling ADO is going to do this? I really do not
like uninstalling and reinstalling software. Aren't there any other options other
than reinstalling software?
 
K

Kevin Yu [MSFT]

Hi Mike,

I completely understand your situation. Currently, I could not reproduce
this issue on my machine. So I can only suggestion you to have a try to see
if re-installing MDAC can resolve this issue.

Actually, installing MDAC 2.8 does no harm to your machine. It upgrades the
dlls if you're currently using an earlier version. And it re-registers
components to make sure they work fine if you have already had MDAC 2.8
installed. However, if you have had Windows Xp sp2 installed, please do NOT
install it, since the version of MDAC in sp2 is newer than 2.8. We cannot
down-grade it.

Also, before re-installing, could you let me know, whether you're
connecting to a remote server or a local database server? Could you please
try to reset the password for the certain user on the server, and connect
again?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
M

Mike Malter

Kevin,

I am connecting to a local database server.

I am running under service pack 2 so I will not be reinstalling mdac 2.8.

Resetting the password on the server does not make sense, Kevin as I am connecting as
a domain user.

I just tried logging into the server again from the server explorer, and now it is
permitting me to login. Nothing was ever changed previously and now mysteriously,
this started working again.
 
K

Kevin Yu [MSFT]

Hi Mike,

This is really mysterious. Anyway, it is good to know that your Server
Explorer is working again. Thanks for sharing your experience with all the
people here. If you have any questions, please feel free to post them in
the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top