Solved

Unable to connect to SQL Server 2005

Posted on 2006-07-20
1
168 Views
Last Modified: 2010-04-30
I was able to connect to a SQL Server 2003 database.  We migrated to SQL Server 2005 and now the exact same connection string no longer works.

Can someone help?

I am referencing the Microsoft OLE DB ActiveX Data Objects 1.0 Library in my VB6 project.

Public Function EstablishConnection(ByVal sServerPath As String, ByVal sDb As String, _
                                    ByVal sUser As String, ByVal sPwd As String) As Boolean

1         On Error GoTo ErrHandler

2         Dim strConnectString As String

4         Set g_cnn = New ADODB.Connection

5         strConnectString = "Provider=sqloledb;" & _
               "Server=" & sServerPath & ";" & _
               "Database=" & sDb & ";" & _
               "User Id=" & sUser & ";" & _
               "Password=" & sPwd

6         g_cnn.Open strConnectString
End Function


Our .NET developers ran into the same situation and had to install the SQL Native Client.  Now they can connect in .NET.

Ive installed the SQL Native Client but still no luck.   If I change the string to "Provider=SQLNCLI;"   what do I reference in my project???

How can I connect to SQL Server 2005 in my vb6 project??

thanks,

knoxxx
0
Comment
Question by:JohnnyKnoxville
1 Comment
 
LVL 10

Accepted Solution

by:
PSSUser earned 50 total points
ID: 17154697
What error message are you getting?

It's worth checking what network library protocols are runninng on the SQL server.

Take a look my 2 answers here:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21541834.html

Regards,

Chris
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now