Search code examples
sql-servervisual-studio-2015driveroledbssms

Is A Driver For SQL Server Corrupt, And How To Fix It If So?


OK, I'm at wit's end here (not like I have many to start with, but that's a different story!). So (sigh)...

Somewhere along the line I get the distinct feeling that one or more of my database drivers have been corrupted or something, and I don't know how to fix the issue without a reinstall of Windows, which would be crazy. Here's the issue:

I am working on several web site projects, and I've been using Visual Studio 2015 Community and SQL Server 2014 Developer at home, with SQL Server Management Studio as the tool of choice for working with the databases, on a Windows 10 64-bit box. I've been developing code locally, and for the last couple weeks I haven't had need to connect to the (eventual) production SQL Server databases on my hosting provider's servers. The last time I connected (maybe two weeks ago) to them everything was fine and dandy, and I'd not had any issues before then with connectivity either.

Yesterday I needed to connect, and so I launched SSMS to sign in to the database. Instead of connecting, I got the error message about "network path not found", meaning SSMS couldn't find the database server. After several retries, I attempted to connect using Visual Studio's Server Explorer window, with the same resulting error message.

I tried to PING the server and was successful. I got a TELNET connection as well to port 1433, so the server name's correct, and I was able to resolve the name to the right IP. Still, I cannot make a DB connection to the remote databases.

I followed all of the suggestions for this basic issue, including turning off Windows Firewall, and I even turned off my cable modem's firewall, just to test whether it was something there. Still no joy.

As the ultimate step, I uninstalled SQL Server, SSMS, Visual Studio, and all of the accompanying bits, plus I deleted all of the folders for Visual Studio and SQL Server, to ensure everything I could find to delete was gone.

I opened a command prompt and ran cliconfg to make sure named that both TCP and named pipes were enabled, and they were.

I installed LinqPad after a reboot just to see if now I could connect, and still nothing.

Interestingly, I changed the connection string in the web.config file for my ASP.NET web site project on the local IIS box to point to the remote server's database, and it works.

So, now I have NO EARTHLY CLUE what's going on with my local machine that could be causing this. I've now spent almost two complete days on this. I haven't reinstalled SQL Server, SSMS or Visual Studio yet, but something's still not right that I can't get to the bottom of. Reinstalling Windows is not really an option if I can avoid it.

The question is, has anyone else run across something like this, and how can it be diagnosed or fixed?


Solution

  • Interestingly, after two maddening days of pulling my hair out, I discovered that the .NET Data Provider For SQL Server was corrupted, evidently by a virus that made it past my AV software and was very stealthy, because the thing it affected was the SQL Server drivers. The way I figured this out was to use the OLEDB data provider in Visual Studio to connect successfully to the remote database, which worked perfectly. The fix to this was to run different AV software, which found and removed the virus, then I reinstalled SQL Server and Visual Studio, and it all works like a charm again!