Hi everybody
In a database where i store sql tables (from remote server)
i'd like to skip uid + pssw in ODBC (DSN)
I'd like user could directly work with data without edit Uid and password...
...following code works but when user exec the access database he have to edit Uid and password to connect to sql server
Private Sub Comando0_Click()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set cnn = New ADODB.Connection
cnn.CursorLocation = adUseClient
cnn.Open "PROVIDER=MSDASQL;" & _
"DRIVER={SQL Server};" & _
"SERVER=servername;DATABASE=databname;" & _
"UID=xxx;PWD=zyz;"
rs.Open "SELECT ..." & _
" From table" & _
" WHERE .... ", cnn
Do Until rs.EOF
Debug.Print rs.Fields(0).Value & " - " & rs.Fields(1).Value
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set cnn = Nothing
End Sub
I expect that the db open without see the Sql connection form
sorry for english
HELP!!!!!!!!!!!!!!!!