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

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 ???
Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
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;" & _
Éric MoreauSenior .Net ConsultantCommented:
Surely because one of the parameter is not the same.

Can you show us your code?
Éric MoreauSenior .Net ConsultantCommented:
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

dynomite082002Author Commented:
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
Éric MoreauSenior .Net ConsultantCommented:
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 & ";"
last connect string must been "DSN=;"
Éric MoreauSenior .Net ConsultantCommented:
the asker wants a DSN-less connection!!!
dynomite082002Author Commented:

Let me test it !
dynomite082002Author Commented:
The SQL Server and other desktop are on different domain.
Éric MoreauSenior .Net ConsultantCommented:
This is not a problem as long as you can ping the server and you have valid user id and password.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.