dynomite082002
asked on
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 ???
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 ???
also have a look at http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForSQLServer
ASKER
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
....
....
Set objConn = New ADODB.Connection
Set objRs = New ADODB.Recordset
objConn.ConnectionTimeout = 10
objConn.CommandTimeout = 10
strConnString = "provider=sqloledb;server=
objConn.Open strConnString
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 & ";"
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=;"
the asker wants a DSN-less connection!!!
ASKER
emoreau,
Let me test it !
Let me test it !
ASKER
The SQL Server and other desktop are on different domain.
This is not a problem as long as you can ping the server and you have valid user id and password.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you show us your code?