远程连接access数据库的几个方法
|
源代码网整理以下远程连接access数据库的几个方法: 源代码网整理以下1.建立VPN(Virtual Private Network),这样你的电脑和主机的连接就与局域网无异,然后把服务器中mdb文件所在的Folder共享即可。ADO连接如下: 源代码网整理以下oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\ServerNameDatabaseFolderDatabase.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" 源代码网整理以下 源代码网整理以下 oConn.Open "Provider=MS Remote;" & _ 源代码网整理以下 "Remote Server=http://myServerName;" & _ 源代码网整理以下 "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _ 源代码网整理以下 "Data Source=c:somepathmydb.mdb", _ 源代码网整理以下 "admin", "" 源代码网整理以下3.自己编写服务器程序,通过TCP/IP,传递Recordset。 源代码网整理以下4.使用第三方控件,如:ADO Anywhere或UDAParts RDB等。具体查看 源代码网整理以下 http://www.adoanywhere.com 源代码网整理以下 http://www.udaparts.com/ 源代码网整理以下5.使用XMLHTTP 源代码网整理以下 -------------------------------------- 源代码网整理以下附 远程连接SQL Server的方法: 源代码网整理以下ConnStr = "Provider=SQLOLEDB.1;Network Library=DBMSSOCN;Persist Security Info=True;User ID=UserName;Password=Password;Initial Catalog=远程数据库名;Data Source=203.129.92.1" 源代码网供稿. |
