If you want to use an ODBC DSN on the remote machine: 测试能过
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=MSDASQL;" & _
"DSN=AdvWorks;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
If you want to use an OLE DB Provider on the remote machine: 测试通过
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;", _
"admin", ""
If you want to use an OLE DB Provider on the remote machine (via RDS DataFactory Default Handler):
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Handler=MSDFMAP.Handler;" & _
"Data Source=MyAdvworksConn;"
The corresponding entry in the \winnt\Msdfmap.ini file would be: 注:测试通过的办法是正确填写Data Source后的绝对路径!!!
[connect MyAdvworksConn]
Access = ReadWrite
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=mydb.mdb;" & _
"User Id=admin;" & _
"Password=;"
本人推荐 (use an ODBC DSN on the remote machine ) 即远程机器上的ODBC DSN 连接...