Solved

Unable to connect to SQL Server 2005

Posted on 2006-07-20
1
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

730 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