Solved

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

Posted on 2002-06-15
10
140 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 69

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 69

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
 
LVL 69

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 69

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 69

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 69

Accepted Solution

by:
Éric Moreau earned 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now