HELP!!! SQL Connection object in VB 2005 not establishing connection with SQL Server 2000 database !!!?
-
I created a DB in SQL Server 2000 and later I attached it with SQL Server 2005 Express. Now, from VB 2005, I am trying to connect to that DB using SQL Connection object. I am correctly setting the Data Source property of SQL Connection object and choosing "Windows Authentication" and browsing for the Data file but as I click the "Test Connection" button it gives me the following error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings sQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40-Could not open a connection to SQL Server) Please guide me how can i solve this problem. Thanks, Zain.
-
Answer:
If you are doing .NET work, have you looked in the machine.config to see what your connection string(s) is(are)? Take a look at this example: <connectionStrings> <remove name="LocalSqlServer"/> <add name="MyDatabase" connectionString="data source=sql2k503.datamain.net;Initial Catalog=SQL20005_DB;User ID=Meuser; Password=abcdef" providerName="System.Data.SqlClient" /> </connectionStrings Hope this helps, or at least points you in the right direction.
PuraniJe... at Yahoo! Answers Visit the source
Other answers
Have you looked at the Configuration/Surface Area Config.? And make sure Named Pipes is enabled, as well as Shared Memory. I had this problem for a while. But it sounds like you're trying to connect remotely. If that's the case, you will enable "TCP/IP", and do "Server=*IP*, *Port*" as the connection string instead.
the_dadd_from_tn2005
Related Q & A:
- Can I create a second filestream container on an existing SQL Server 2008 database without going offline?Best solution by Database Administrators
- How to connect Sql Server Database from android app?Best solution by Stack Overflow
- How to upgrade sql server express 2005 to 2008R2?Best solution by Server Fault
- What is the best practice for free space for a SQL server database drive?Best solution by Database Administrators
- How to Restrict Database for One User in SQL Server 2008 R2?Best solution by Database Administrators
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.