Connect to Access database using Internet

I have a Web Service running on my ISP's web server.  I have an Access database on the same server.  I can connect to the Access database using both OLEDBConnection and ODBCConnection.  Now I need to connect to an identical Access database running on a Window XP Home PC.  I know the IP Address of the PC.  I am able to make the connection using VB6 and the following connection string:

Connstring = "Provider=MS Remote;Remote Server=http://" & "xxx.xxx.xx.xx" & ";DSN=TestDB;UID=;PWD=MyPassword;"

I haven't been able to find any documentation for connecting to a database over the Internet.  I've tried everything I can think of, but without documentation, I'm shooting blind.  Here is my latest failed attempt:

Conn.Open("Provider=MS Remote;" & _
                   "Remote Server=http://xxx.xxx.xx.xx;" & _
                   "Remote Provider=MSDASQL;" & _
                   "DSN=TestDB;" & _
                   "Uid=;" & _
                   "Pwd=MyPassword")

Has anyone been able to this   Is there a better way to handle the connection



Answer this question

Connect to Access database using Internet

  • Jerry Xin

    There is a VERY large body of literature available about web services.

    Web services are programming API exposed via web server, for programmatic access to invoke remote objects, methods. Web pages are for humens to read via browsers, web services are application logic to invoke through application code.

    Like using web pages as a database front end, you decide what to be on your pages, how the pages are related to the database, so you first define what data access methods you want to expose with web services. Say, get some or all the records from a table, update or insert or delete some rows, all the database operations packaged a set of data access methods can be exposed as web services, you need to decide what those methods should be, that is, define your data access layer. Making web service front end for data access layer is easier than making ASP.NET pages, no need for nice looking page layout.

    With the web services running on your web site, you can build a web service client, which is usually a Windows application, interacts with the web services through web service proxy (Visual Studio .NET creates the proxy for you, when add a "web reference" to your web services). The web service front end and client proxy together works as the communication component for your Windows application, provides remote access to the data access layer running on web server.

    That's what accessing remote stuff will take as a minimum. There are other things to worry about, like authentication, messaging security (web services send back and forth data in SOAP XML, the data is in clear text.), and performance (may not be a real concern, if usage will be light.). 

    I like building secure, fast applications to run over HTTP, but don't like to deal with all the tedious work required using web services, so I developed an alternative for .NET communication over HTTP, my "Remote Object Invocation framework", which takes care of creating the entire communication systems for .NET applications, makes developing applications to run over the web as simple as LAN-based applications. My remote SQL database provider was made with this framework. 
         

  • Ollie VB

    Thanks for the reply.  Please excuse my ignorance, I'm new to .NET.  Your last sentence "you can make a web service on your web server, run a web service client.".  Could you explain   I have a web service running on a web server, but what is a "web service client".  Are you suggesting that this may work without copying the database   Copying the database is not an option.
  • satyarup Siddhanta

    If you are using .NET, .NET Data providers do not work over HTTP, you can not get remote access to data the way shown in your code. That provider in your code is for the old ADO RDS, you should look into RDS for more info.

    I made a .NET SQL database provider that works over HTTP, called WebSql Data Provider, it's for SQL Server only.
     
    The easiest, may not fit your purpose, just download/copy the Access file to your XP. If that would miss some new data, you can make a web service on your web server, run a web service client.

  • Connect to Access database using Internet