Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unable to connect to SQL Server 2005

Posted on 2006-07-20
1
Medium Priority
?
179 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

604 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