Solved

Unable to connect to SQL Server 2005

Posted on 2006-07-20
1
167 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

707 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

12 Experts available now in Live!

Get 1:1 Help Now