Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Connect vb6 app to remote db

Posted on 2013-01-05
5
Medium Priority
?
528 Views
Last Modified: 2013-01-05
I am trying to connect my vb6 app to either a local or a remote database, depending on which is selected.  Here is my connection string:

    If sWhichSrvr = "Remote" Then
        conn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CCMeet;User ID=id;Password=pwd;Data Source=209.185.199.1,1433\SQLEXPRESS"
    Else
        conn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CCMeet;UID=id;Pwd=pwd;Data Source=VIRA-5\SQLEXPRESS"
    End If

Open in new window


I get a "server not found" error when I try to connect.  Is there an error in my string or my process?
0
Comment
Question by:Bob Schneider
[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
  • 3
  • 2
5 Comments
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 2000 total points
ID: 38747403
SQLOLEDB is an old driver.  The preferred and current driver for SQL Server 2008 is the SQL Server Native Client 10.0 which can be downloaded here:  http://www.microsoft.com/en-us/download/details.aspx?id=16978   Look for Microsoft® SQL Server® 2008 R2 Native Client in the middle of the page and pick the version for your computer.

On this page are connection strings for using SQLNCLI10: http://www.connectionstrings.com/sql-server-2008

SQL Server must also be setup for TCP/IP remote access using SQL authentication.  If you are trying to access it using 'named instance' like 209.185.199.1,1433\SQLEXPRESS or VIRA-5\SQLEXPRESS, the Sqlbrowser.exe service must also be running on port 1434.
0
 

Author Comment

by:Bob Schneider
ID: 38747493
Good information.  Sqlbrowser.exe (I assume that is SQL Server browser in the "Services" area?) is running but I can't see how to check the port it is running on?  TCP/IP is enabled but how do I check if it is using SQL authentication?
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 38747591
Sqlbrowser.exe always runs on port 1434 as far as I know.  Allowing Remote connections is a checkbox on the Properties for the server instance (top of the list).  SQL authentication is set up for a user in the Properties for their Login when it is created.  And under the Properties for the database you're using, you may have to setup permissions for that login.
0
 

Author Closing Comment

by:Bob Schneider
ID: 38747604
Incredibly helpful!!
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38747625
Glad to help.
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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

721 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