i use this:
Code:
Dim con As ADODB.Connection
dim rs As ADODB.Recordset
Dim DB
Dim vProvid
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
uid = ""
pwd = ""
DB = "\\myserver\production\Generic104J.accdb"
vProvid = "Microsoft.Jet.OLEDB.4.0" ' "SQLOLEDB"
With con
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("User ID").Value = uid
.Properties("Password").Value = pwd
.Open "Data Source=" & DB
End With
Set rs = con.Execute("qsNames_simps")
rs.Close
con.Close
set rs = nothing
set con = nothing