Dreaded "Could not open a connection to SQL Server" error RRS feed

  • Question

  • I have developed several programs (in the same solution) with VB8 (VS2005Pro) which access a SQL Server 2005 Dev database. Development computer uses Vista 64-bit. The database is installed in a subdirectory of the app directory.


    Here's the sql to attach the db:

    if not exists(select * from sys.databases where name = 'TheDbName') EXEC sp_attach_single_file_db @dbname ='TheDbName', @physname = 'ThePathToDbName'


    Here's the connection string:

    Data Source=ThePCName\TheServerName;Database='TheDbName';Integrated Security=SSPI;Persist Security Info=False


    The programs run fine on the development machine (Vista 64-bit), and two other test machines in my office (Vista 32-bit and XP 32-bit). They had previously worked on my client's computers (two XP 32-bit and one XP 64-bit), but suddenly stopped with the installation of the latest and a previous version. The latest version had no changes regarding data access. However, the programs have stopped working on the client's computers (all three); they display the aforementioned error.


    Over the phone, I went thru the procedures with the client to verify Surface Area Config and Config Manager were set correctly. All the settings appear to be the same (remote enabled, etc) as my computers. The only thing new, according to the client, is that two of the computers (32-bit) have had a new virus protection program installed from a company called Charter. He disabled the firewall but that did not help and does not explain why the 64-bit is generating the same error.


    I have read numerous posting on the MSDN forums and have checked everything I can think as well as suggested resolutions posted. Still not working. Can anybody suggest a course of action?

    Sunday, November 4, 2007 9:55 PM