Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2002-06-15
10
Medium Priority
?
148 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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses

877 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