I have just moved from Vista to Windows 7 with my development environment and ALL OF A SUDDEN my web app cannot connect to the local SQL Server instance

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Funily enough, SQL Management studio express can connect fine. The connection string im using is:

Provider=SQLOLEDB.1;User ID=sa;Initial Catalog=mydatabase;Data Source=.\myinstance;Password=xxx

Does anyone have any idea as to why?

link|improve this question

40% accept rate
feedback

4 Answers

up vote 1 down vote accepted

Thanks all for your responses, I fixed the problem by changing the connection string as follows:

Provider=SQLOLEDB.1;Network Library=DBNMPNTW;User ID=sa;Initial Catalog=mydatabase;Data Source=\\.\pipe\MSSQL$myinstance\sql\query;Password=xxx
link|improve this answer
feedback

Try to configure the ALIAS on Microsoft Client Network Configuration.

link|improve this answer
feedback

Check the status of the "Login" that you are using, through SSMS. Also read the error for any error messages.

link|improve this answer
feedback

Perhaps you installed the database instance in Windows Only authentication mode and sa is disabled.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.