Steps to Client/Server

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Getting Started >

Steps to Client/Server

The following describes the pcoess of moving to client/server with Apollo Database Server.

The Client/Server or Enterprise Edition of Delphi/C+Builder is not required to develop client/server applications with Apollo. The Professional Editions of either product will work fine.

The TApolloTable component has a property called "AccessMethod" that can be set to "amLocal" or "amServer". AccessMethod set amServer allows your applications to connect to an Apollo Database Server. Setting this property to amLocal makes your Apollo applications connect directly to Apollo data engineDLLs. This is referred to as local mode. Connecting to files on a different drive (i.e. mapped directories) is called peer-to-peer mode, and is not to be confused with true client/server mode where processing is done at the server via Apollo Database Server.

Migrating from local mode to client/server

1.Install any edition of the Apollo Database Server (e.g. 2-User) onto your server or local computer.

image\tip.gif Your local computer can mimic a server. The IP address for your local computer is 127.0.0.1.

2.Run the Apollo Database Server on the server computer or from your local machine.

       (i.e. C:\Apollo\9.9\x86\VCL\Server\ApolloServer2User.exe or C:\Apollo\9.9\x64\VCL\Server\ApolloServer2User.exe)

3.Copy your local data files to a directory that is accessible by the Apollo Database Server installed in the previous step. This data directory must have read/write access. (e.g. C:\Apollo\9.9\x86\Data)

4.Run the Apollo Database Server Manager from the local or remote computer or from the server machine itself. This program can be found in C:\Apollo\9.9\x86\VCL\Server\ADSManager.exe)

image\tip.gif The ADS Manager lets you connect to the Apollo Database Server remotely over the Internet.

5.Use the Manager program to configure the Apollo Database Server so that it knows aobut your new data directory and any new users, etc. Specifically, add a new Database to the server.

6.From the Apollo Manager application, create a new database alias that points to your data files (i.e. MYDATA to point to C:\MyData).

7.Open your application under Delphi/C++Builder and add a new TApolloConnection component to your main form or datamodule. Name it "MainApolloConnection" and set the following properties:

       Host to: 127.0.0.1 // or www.myserver.com
       Port: 8121
       User: SYSDBA // default login name and password
       Password: masterkey

8.Set to MainApolloConnection.Active to True. This will establish an immediate connection to the Apollo Database Server. If you experience a connection failure, go back to Step 2. Make sure the server is running.

At this point, you have successfully connected your application to the Apollo Database Server and are now ready to convert your actual code to use the server.

1.For each TApolloTable on your form(s), set the ApolloConnection property to "MainApolloConnecton" or whatever you named it. This will automatically change the "AccessMethod" property from "amLocal" to "amServer", which means the data will be accessed by the Server.

2.Set the DatabaseName to the Alias name created in Step 6 above (e.g. MYDATA)

That's it. Your application will now be running in client/server mode over the LAN or Internet. To switch back to local mode, change TApolloTable AccessMethod from amServer to amLocal and set your databasename to the path of your data.

See Also

Moving to Client/Server