In general, you can open a file share in a remote folder by accessing it as you normally would with a connection string, paying attention to shared read and write permissions.
Example of connecting an Access database remotely (such as over the Internet):
First, you need to use Tcp/ip,ado and XML (you need to install Microsoft XML 4.0. )。 Note Server and client two parts, the server can be multi-user simultaneous connection. (Note: You do not need to use RDS or a Web server.)
Several ways to connect to an Access database remotely:
1 Set up a VPN (Virtual Private network) so that your computer and host connection is the same as the LAN, and then the server in the MDB file is located in the folder to share. The ADO connection is as follows:
The following is the referenced content: oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=servernamedatabasefolderdatabase.mdb; Jet Oledb:database PASSWORD=DATABASEPW; Persist Security Info=false " |
2. Place database on the Web server to enable ADO or RDO to be implemented via RDS (Remote Data Service) and IIS:
If the server set up an ODBC DSN like the one above Jave says:
Here is the code snippet:
The following is the referenced content:
oConn.Open "Provider=ms Remote;" & _ "Remote server=http://myservername;" & _ "Remote Provider=msdasql;" & _ "Dsn=advworks;" & _ "Uid=myusername;" & _ "Pwd=mypassword" |
If you are setting up OLE DB Provider:
The following is the referenced content: oConn.Open "Provider=ms Remote;" & _ "Remote server=http://myservername;" & _ "Remote provider=microsoft.jet.oledb.4.0;" & _ "Data Source=c:somepathmydb.mdb", _ "Admin", "" " |
3. Write your own server program, pass the recordset through TCP/IP.
4. Use third-party controls, such as ADO anywhere or udaparts rdb.
5. Using XMLHTTP
Ways to connect to SQL Server remotely:
Code snippet:
ConnStr = "Provider=SQLOLEDB.1; network Library=dbmssocn; Persist security Info=true; Userid=username; Password=password; Initial catalog= remote database name; Data source=203.129.92.1 " |