#1 2013-04-20 12:19:50

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Table creation and Client-Server...

Hello,

Am trying to develop a simple Client-Server DB application to which a client can connect from
a different PC using service names (no Web-browsing so no HTTP).

Was thinking that if one puts the code to generate the tables in the server-side,
then one still needs that table definition code on the Client-side
in order to perform routines for input data into the tables.

So is one supposed to write a shared unit for the DB table
definitions that gets shared by both the server and the client side
or am I missing something?

Am grateful for any pointers,
Regards
Sami


Below is a sample of the server code.

   

Var
  aModel   : TSQLModel;
  aProps   : TSQLDBSQLite3ConnectionProperties;
      aServer : TSQLRestServerDB;
BEGIN
  aProps := TSQLDBSQLite3ConnectionProperties.Create(ChangeFileExt(paramstr(0),'.db'),'','','');
  Try
    aModel := TSQLModel.Create(
    [TSQLAuthGroup,TSQLAuthUser,
      TSQLBabies,
             ],ROOT_NAME);
    VirtualTableExternalRegisterAll(aModel,aProps);
      aServer :=   TSQLRestServerDB.Create(aModel,'Babies.DB3',
                  CHECK_USERS);

    Try
      With aServer Do
      Try
        CreateMissingTables; 
 ........

Offline

#2 2013-04-20 12:42:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: Table creation and Client-Server...

What is wrong with using the TSQLRestClientURI class on the client side, and let all the Client-Server ORM be done automatically for you?

Offline

#3 2013-04-20 13:45:34

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: Table creation and Client-Server...

Yes, am actually using TSQLRestClientURINamedPipe to
connect on the client side, although the server and client are still
in the same PC.

The client can now successfully retrieve data from a table defined on
the server, My mistake sorry, no additional definitions are
needed on the client side, thanks for pointing this out.

I assume when the server is located physically on another PC,
this method should still operate rather fast?

Thanks a lot,
Sami

Offline

#4 2013-04-20 15:49:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: Table creation and Client-Server...

For remote access you should better use htpp.

Offline

Board footer

Powered by FluxBB