Solved

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

Posted on 2002-06-15
10
141 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 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…
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…

911 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