Recent

Author Topic: 3-tier Database Application  (Read 3126 times)

denver

  • Jr. Member
  • **
  • Posts: 67
3-tier Database Application
« on: August 03, 2012, 11:16:04 am »
I develop a simple 3-tier database library Version 0.1
It is very easy to use. This version is applied to fpc/win32 only and will port to other OS later.
How easy ? Just look at the following code samples :

Include the following units: pinousclient, db, memds

Code: [Select]
var
   mConn : TdgsClient ;
   mdb : TMemDataSet ;
   mError : String ;   
begin
   mdb := TMemDataset.Create( nil ) ;
   mConn := Tdgsclient.Create ;
   // SetHost( 'serverip','key in dgserver.conf','alias', serverport )
   mConn.SetHost( '127.0.0.1','123456789','PDEMO',6999 ) ;
   mConn.Connect ; 
   mError := mConn.ActiveSQL( mdb, 'select * from salesman' )  ;  // your SQL here
   if mError <> '' then
      WriteLn( 'Error : ' + mError )    //  Show error message from server
  else
     begin
     // show the content of database ;
     mdb.first ;
     while not mdb.Eof do
        begin
        WriteLn( mdb.FieldByName( 'salesid' ).AsString + ':' + mdb.FieldByName( 'salesname' ).AsString ) ;
        mdb.Next ;
        end ;
      end;
    // Disconnect from server and Free
    mConn.DisConnect ;
    mConn.Free ; 
    mdb.Free ;

end ;

You can download the wrapper / library and the server here :  http://www.francogrp.com/3-tier-demo0.1.zip
The performance is awesome !

Have fun !