1.建立VPN(Virtual Private
Network),这样你的电脑和主机的连接就与局域网无异,然后把中mdb文件所在的Folder共享即可。ADO连接如下:
oConn.Open
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=//ServerName/DatabaseFolder/Database.mdb;Jet OLEDB:Database
Password=databasepw;Persist Security Info=False"
2.把Database放在Web
Server上,使ADO或RDO通过RDS(Remote Data Service)及IIS来实现:
如果像上面Jave大侠说那样设置了ODBC
DSN的话:
oConn.Open "Provider=MS Remote;" &
_
"Remote Server=http://myServerName;" &
_
"Remote Provider=MSDASQL;" &
_
"DSN=AdvWorks;" & _
"Uid=myUsername;" &
_
"Pwd=myPassword"
如果设置的是OLE DB Provider
的话:
oConn.Open "Provider=MS Remote;" &
_
"Remote Server=http://myServerName;" &
_
"Remote Provider=Microsoft.Jet.OLEDB.4.0;"
& _
"Data Source=c:/somepath/mydb.mdb",
_
"admin", ""
3.自己编写程序,通过TCP/IP,传递Recordset。
4.使用第三方控件,如:ADO Anywhere或UDAParts
RDB等。具体查看
http://www.adoanywhere.com
http://www.udaparts.com/
5.使用HTTP
附 远程连接SQL Server的方法:
ConnStr = "Provider=SQLOLEDB.1;Network
Library=DBMSSOCN;Persist Security Info=True;User
ID=UserName;Password=Password;Initial Catalog=远程名;Data
Source=111.11.11.1"