Remote SQL Server Connection via VB 6

I am trying to open a connection to a database on my server from within a vb6 program using the same connection string that I use to access the data online via classic asp web page.  I am getting the following message: "Named pipes provider:  could not open a connection to sql server."
Bob SchneiderCo-OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
What driver and connection string are you trying to use?  I would think that VB6 should probably use a DSN thru the ODBC connection manager.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob SchneiderCo-OwnerAuthor Commented:
Here is my connection string (again, worked fine on the old server and works fine now via a classic asp page): srvr_conn.Open "Provider=SQLNCLI11;Server=72.52.136.29;Database=db_name;Uid=uesr_name;Pwd=password;"
0
SethiCommented:
You have to mention the name of your computer along with Server IP. Like this: YourComputerName\72.52.136.29.

Also through SQL Server Configuration Manager make sure Named Pipe is enabled.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

SethiCommented:
If the connection is being made on network then it would be: \\YourComputerName\72.52.136.29
0
Bob SchneiderCo-OwnerAuthor Commented:
Why don't I have to mention the name of my computer when doing the same thing from the web via classic asp?  Also, by "YourComputerName" do you mean the one that i am sending the request from or the server that is receiving the request.  I thought the IP address clearly identified the server and why would I preface that with the name of the computer sending the request?  I guess I am puzzled.

Further, the old server (a Windows Server 2008 with sql server 2012 express) did not need that.  Please fill me in on what I am missing.  I will look at the named pipes setting.
0
Bob SchneiderCo-OwnerAuthor Commented:
Named Pipes are enaled everywhere I looked.
0
SethiCommented:
Well, I won't be able to answer a lot of "Why" about Computer name but having computer name with SQL server name is the correct syntax for Windows application. My guess for ASP is that it goes through IIS Server and uses TCP/IP protocol and that's why we don't need to pass the computer name.

So using your server with computer name is all that needs to be done.
0
Dave BaldwinFixer of ProblemsCommented:
In my experience, using the IP address means that the SQL Native Client and the SQL Server must both have TCP/IP connections enabled.  And if you are not on the same machine as the server, then the server must also have 'Remote Connections' enabled.
0
Dave BaldwinFixer of ProblemsCommented:
You might try setting up a DSN thru the ODBC manager on the machine where the VB6 program is running to see if your credentials are being accepted.  Note that if the ASP page is running on the same machine that the SQL server is on, it is not a 'Remote Connection'.
0
Anthony PerkinsCommented:
I am not sure I am following you entirely, but perhaps the SQL Server Native Client is not installed on this workstation?
0
Bob SchneiderCo-OwnerAuthor Commented:
I upgraded from sql server 2008 r2 express.  I have sql server 2012 express on my local machine along with sql server 2008 r2 express.  I have a configuration manager under the 2008 sql server but I don't see it in program files under the 2012.

Note that this worked well on my old server (same workstation and a server running windows server 2008 and sql server 2012 express).  It is not working on the new server (running windows server 2012 and sql server 2012).

Hopefully this will help you help me narrow it down.

Thank you very much!
0
Anthony PerkinsCommented:
It is not working on the new server (running windows server 2012 and sql server 2012).
So this server is running the Express Edition?  If so I suspect it is a named instance and you may have to connect as 72.52.136.29\SQLExpress.  Have you tried that?

You can confirm whether you can see it by running this from the command line:
SQLCmd /L

It should list all the SQL Server instances that are available.  If there are named instances then assuming that the SQL Browser service is running, they should be displayed as computername\instancename
0
Bob SchneiderCo-OwnerAuthor Commented:
There was only one instance but it turned out to be express.  Nonetheless, the firewall was blocking the connection.  All is resolved now.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.