How to connect to an MS Access database that is located on the internet.

Hello,

I would like to connect to a MS Access Database (MDB) from within a Delphi application.
The Database however is on the internet.
Is there a way to do this?

If this is very complicated than maybe it is easier to do it with a MySQL database.

Please supply me with some working sourcecode.
And if it is very complex coding, than please document it, so I can read and adjust it to my needs.

Thanks for your help,
Stef
Stef MerlijnDeveloperAsked:
Who is Participating?
 
Wim ten BrinkConnect With a Mentor Self-employed developerCommented:
I think with MySQL it would be just a matter of using DBExpress and provide it the servername of the database on the Internet, with the right username and password, of course. This server will have to be running some MySQL internet-related service, of course.

But with Access you just ran out of luck. You could use the ADO type library, of course, to connect to a remote recordset but that won't work over the Internet. Basically, if there is no database server software running on the server then you cannot connect to the database. Access doesn't even have any database server software, just a GUI application that helps you to work with the data.

The best solution would be to write a client-server solution and since you want to connect to the database over the Internet, the best solution would be SOAP/Webservices. This is a reasonable new technique and pretty complex for the inexperienced developer. However, client/server software does require you to install software on this server...

In the worst case, I would suggest that you use FTP to get the database from the server to store it locally, then modify it on your local system and use FTP again to send it back to the server. Not a pretty solution.

Is there no other way that you can access the database?

Btw, you could consider using SQL Server with some XML/SOAP extention. There's some add-on available for SQL Server that allows you to execute queries through the URL. You then call this URL and it will return an XML file back to you with the proper contents. I have seen this work quite well, once. Just never used it myself.
0
 
vadim_tiCommented:
i think the simplest way is to write web service dll , it will make all access to database,
and you will connect to this web service dll.
0
 
Stef MerlijnDeveloperAuthor Commented:
An option could be the following:
Opening a webpage inside my Delphi application.
The webpage should then handle all the data mutations.

This way I could handle the database on the webserver itself (with PHP + MySQL) and just open the page in my Delphi application.

So then the question will be:
How do I open a webpage within my Delphi application, without losing fuctionality that would be available when I opened the same webpage with my Internet Explorer browser. Afterall I still need to be able to update the database properly.

The webpage should however be protected by username/password so not everybody can enter data in my Internet-database. From within my Delphi application I must be able to logon without user interference.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
vadim_tiCommented:
you can make special tags for your queries on server side (tags that not in use in regular browsing)
and to use indi TIdHTTP component with its GET or POST methods.
0
 
VoodoomanConnect With a Mentor Commented:
Hi

If the MySQL database is running on a Web server you can connect to it through ODBC.

Instead of entering the name of the server, you enter the IP address, its the same thing (DNS supples a name).

By simply supplying the login and data base, you can connect to your database.

Its the same if your server is running SQLServer.  Your ISP will give you the IP of the server.

You would not want to do this over a dialup however as it will be slow.  It should be ok over 64k ISDN as it is just the same as running over a WAN on 64k dialups (done it lots of times - even wtih traffic on the WAN).

Should be pretty good over ADSL, depends on the number of  databases hosted by your ISP on that particular server.

Remember - it will be slow compared to your network where you will be running 10m or more usually 100mb over the LAN - but not too bad!

Voodooman
0
 
Stef MerlijnDeveloperAuthor Commented:
Thanks so far. I need some time to figure out what could be working for me.
Please be patient!
Any other suggestions are welcome.

Stef
0
 
KgondronCommented:
Hey VoodooMan:
  Exactly how do I construct an ADO DSN to connect to a MYSQL database over the internet?  Which driver do I use?  Can I get a MYSQL Driver?
Keith
0
 
Stef MerlijnDeveloperAuthor Commented:
I use MyComponents from www.SciBit.com.
It comes with a MySQLServer component to connect directly to your MySQL database.

Works very good for me.
0
 
VoodoomanCommented:
Hi

For the UNC name of the server you use the IP Address - simple.

So if you build an app that works over your network, you simply replace the name of the server with the I.P. Address of  the Server where your SQL Database resides.

If you  re lucky enought to have your own server on your domain, you can of course just use your domain name (e.g. www.voodooman.com).

If you dont believe me, open a dos prompt window and 'ping www.google.com' it will return the I.P address of google (66.249.97.104) and the ping!

Voodooman
0
 
KgondronCommented:
I believe you, but to build the connection string, I need a driver.  SQL Server driver won't do, and I don't have a driver listed that says MS ADO.  When I try to construct the DSN, it needs a driver.
Keith
0
 
VoodoomanCommented:

Hi Keith

You can get the driver from the MYSQL SIte http://dev.mysql.com/downloads/connector/odbc/3.51.html this is the ODBC Driver, so you can connect easily over ODBC you can then use the DSN NAme with the appropriate string (depends the documentation).

To test your connection, use MSAccess and attempt to open the DSN by Attaching the Tables.

There is an obvious disadvantage to this as when you connect with attached tables a copy of the table is dragged over the internet.  This does  not occurr when connecting directly to MYSQL.  You can get various free utilities for managing your MYSQL tables from the same site.  Set up the ODBC driver and then open it with the manager.

Easier than you might think.......

Voodooman

Voodooman
0
 
VoodoomanCommented:

Admin console form here http://dev.mysql.com/downloads/administrator/1.0.html

If you know nothing about Server Databases, I suggest you get MYSQL going on your PC (download again from MYSQL) get connected with that and then just change the DSN to point to your MYQSL Server.


Voodooman
0
 
KgondronCommented:
Fantastic.
Thanks.
0
 
VoodoomanCommented:
You  are welcome!
0
All Courses

From novice to tech pro — start learning today.