Technical Information Database TI4335C.txt - How do I create a simple MIDAS Client Server application? Category :Database Issues Platform :Win95/NT Product :C++Builder3.x, Description: How do I create a simple MIDAS Client Server application? Reference: Creating the Server 1. File | New Application 2. File | New | Remote Data Module 3. Type in the name. Mine is "ExampleDataModule". 4. Put down whatever you want to send to the client as data. You can use TQuery or TTable. I'm going to use TTable exporting one of the example databases we ship with C++Builder3. Properties set are: Table1->DatabaseName = BCDEMOS Table1->TableName = animals.dbf 5. Right click on Table1, choose "Export Table1 from Data Module". (If you go to View | Type library, you will see that Table1 is exported as an IProvider.) 6. Now build and run the server. After running it you can close it down. It just needed to get registered. (If you put the server on a remote system then it will have to be registered with regsvr32.exe on both systems) Creating the Client 1. Go to Project | Project Manager and click the New button. Choose new Application. 2. Drop down a TMIDASConnection. (If you wanted to use DCOM and run the server remotely then you would have to set the computer name that the server is registered and running on.) 3. Set the property (Notice that the server has been registered.): MIDASConnection->ServerName = Server.ExampleDataModule 4. Drop down a TClientDataSet on your form. Set the properties: ClientDataSet1->RemoteServer = MIDASConnection; ClientDataSet1->ProviderName = Table1; (Notice that Table1 has been exported) Set Active to true: ClientDataSet1->Active = true; 5. Now do normal database stuff... I put down a TDataSource and a TDBGrid to view the data. 3/16/99 8:02:56 AM
Last Modified: 01-SEP-99