Talk to ACCESS database to do server

xiaoxiao2021-03-06  84

In the next time, Delphi has made a single-machine version of software with Delphi. The database uses Access, the development process is relatively smooth. How to know the world is difficult to expect, some customers put forward this software in the network environment!

I believe many friends have encountered such problems. Now there are 3 ways to go, one is to upgrade the Access database to the SQL Server database, and one is still using Access, but makes it shares data on the Internet, the third is what we are going to discuss today, transform Access As a database server!

I used the easiest way, it is recommended that customers put this software in a fully shared folder, which machine is used, create a shortcut. Hey, the biggest advantage of this method is not to use me again.

Later I thought, can I transform the Access database into a server version?

This is the advantage:

I immediately thought of MIDAS technology (now renamed Datasnap). Can you transform the Access database into server version by creating an application server?

I immediately tried the test transformation. Just choose a machine to do server (the operating system is best in Win98 or more), with the Socket connection method, put the Access database on top, run the application server software transformed with DataSnap technology, then copy the client software to another A machine runs.

There are 2 points here: First, the server must first run SCKTSRVR first, this program Delphi has itself, and the other is to copy the midas.dll file to the client's system folder.

As a result, I don't understand, the client can read the data on the server, but can't submit changes!

The original data connection is Jet.OleDb.4.0, remember that I have used BDE to test, even ordinary DBF files can do server, will the question not here?

So I configured a connection to the Access database in the ODBC, and then select this database alias with BDE Database components. This time, everything is normal, success!

A problem is left, the BDE and ODBC packaging issues. These two configurations are more troublesome, can be implemented using the program to modify the registry, but there is a simpler way. Nowadays, there are many features that automatically configure BDE and ODBC. You may wish to package them with these tools. Moreover, since the multi-layer database development is used, as long as it is configured over the server, the client only needs an additional midas.dll file.

This is the result of my own trial. I don't know who has a better way, I hope to enlighten me.

转载请注明原文地址:https://www.9cbs.com/read-122003.html

New Post(0)