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

x
?
Solved

I have DSN less but it is not working on other pc....

Posted on 2002-06-15
10
Medium Priority
?
146 Views
Last Modified: 2012-05-04
I have MS SQL Server on my Laptor. I used VB to create
a DSN less connection to MS SQL Server by using ADO 2.1.

Everything is working fine on my laptor. When I put my exe
into another desktop, the dsn less connection failed.

In order to make it connect, I have to create physical ODBC connection to my MS SQL Server. Why ?

How to make DSN less connection working on other desktop ???
0
Comment
Question by:dynomite082002
[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
  • 6
  • 3
10 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7080383
Surely because one of the parameter is not the same.

Can you show us your code?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7080385
0
 

Author Comment

by:dynomite082002
ID: 7080584
Here is my code :

....
....
  Set objConn = New ADODB.Connection
  Set objRs = New ADODB.Recordset
  objConn.ConnectionTimeout = 10
  objConn.CommandTimeout = 10

  strConnString = "provider=sqloledb;server=" & arryINI(1).strDBServer & ";database=" & arryINI(1).strDBName & ";uid=" & arryINI(1).strDBLogin & ";pwd=" & arryINI(1).strDBPassword
  objConn.Open strConnString
0
Industry Leaders: 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!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7080590
Try using this syntax:

oConn.Open "Provider=sqloledb;" & _
           "Data Source=" & arryINI(1).strDBServer & ";" & _
           "Initial Catalog=" & arryINI(1).strDBName & ";" & _
           "User Id=myUsername=" & arryINI(1).strDBLogin & ";" & _
           "Password=" & arryINI(1).strDBPassword & ";"
0
 
LVL 4

Expert Comment

by:TigerZhao
ID: 7082781
last connect string must been "DSN=;"
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7082782
the asker wants a DSN-less connection!!!
0
 

Author Comment

by:dynomite082002
ID: 7083517
emoreau,

Let me test it !
0
 

Author Comment

by:dynomite082002
ID: 7097618
The SQL Server and other desktop are on different domain.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7097652
This is not a problem as long as you can ping the server and you have valid user id and password.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 7097653
try this:
To connect to SQL Server running on a remote computer (via an IP address)

oConn.Open "Driver={SQL Server};" & _
           "Server=xxx.xxx.xxx.xxx;" & _
           "Address=xxx.xxx.xxx.xxx,1433;" & _
           "Network=DBMSSOCN;" & _
           "Database=myDatabaseName;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword;"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

670 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