Solved

Unable to connect to SQL Server 2005

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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