    22  

        

      /    ,  , 
 -  ,       
  .  -    
   .    -  
   ,     
"/". ,   ,     
    ,      
   . 
          /,   
  .      
     ,    
-  .   ,   -  
        
 . 
            
 ,     .    
,    ,    ,   
        
.     -  
        . 
      ,    -. 
          ,  
    /   .   
          
  ,     
 . 
    Delphi       . 
    Q	Remote Data Broker (  ) 
    Q	Constraint Broker ( ) 
    Q	   
    Q	    
             ,   
   . 

    Remote Data Broker 

     Remote Data Broker    Delphi   
   (thin-client),     
        .   
        , 
   , TQuery  TStoredProc,   
    .      
  -,     
     .  , -  
,      ,      
 -. 
        Remote Data Broker   . 

    432 IV.    

    1.   ,   InterBase . 
    2.    Database Explorer     BDE   
IB_EMPLOYEE,     InterBase EMPLOYEE. 
GDB,      Delphi (     
 : \Program Files\Borland\IntrBase\Examples). 

     

      Delphi       
   ,   Borland Database 
Engine,           . 
     DBCLIENT.DLL,     
   .   DBCLIENT.DLL  
    ,        
   ,         . 
    3.             - 
    Import to Dictionary.   
         InterBase  
   Delphi. 
    4.      Database Explorer    Delphi. 
    5.       File^New Application   . 
    6.      File^New      Remote Data 
Module    New Items. 
    7.     Class Name of Remote Data Broker    
Remote Dataset Wizard   ,     . 
    8.        , Database  Session. 
    9.       AutoSessionName  Session  True. 
    10.      AliasName  DatabaseName 
 Database  IB_EMPLOYEE.   LoginPrompt  
   False     Pa rams   : 

    USER NAME=SYSDBA PASSWORD=masterkey 

    11.    HandleShared  True. 
    12.      DatabaseName  Table 
 IB_EMPLOYEE,      TableName    DEPARTMENT. 
    13.       Table    
    Export Table'1 from data module. 
    14.    :  Unit2    RDB01. PAS,  
Unitl    RDBOO . PAS,       RDB. DPR. 
    15.    RDB,      
-.      . 
    ,    ,     
  . "  RDC (Remote Data Client 
   )   . 
    1.	   File^New Application    Delphi. 
    2.	     ClientDataSet, RemoteServer  DataSource. 
    3.	    DBGrid. 
    4.	  ServerName  RemoteServer  RDB.RemoteDataBroker. 
    5.     RemoteServer  ClientDataSet  
RemoteServerl,    ProviderName   Tablel (Tablel   
 DEPARTMENT    RDB). 
    6.              DataSet      
DataSource         
    ClientDataSet,   DataSource  DBGrid    DataSourcel. 
    7.     ClientDataSet,    Active  True. 

     22.     433 

     DBGrid      DEPARTMENT.   
        Remote Data Broker  
 -. 
       ,    :  Unitl   
 RDCOO. PAS,       RDC. DPR. 

      

           ,  
    Delphi       
() .    , 
  ,       
.         . 
 ,   ,  . 
    1.      Delphi  RDB. 
    2.       ,     Table. 
,    ,    <Ctrl+A>.  
  ,        DEPARTMENT. 
    3.       Budget    .   Object 
Inspector     ImportedConstraints. 
    4.     ,      . 
    5.      RDC   . 
    6.        ,   
DEPARTMENT     DBGrid.     
Budget   ( ,  10001). 
     ,        
  .      
     ,     
. ,         . 

        

        , Delphi   
   .      
   ,    (briefcase 
computing).    . 
    1.	  RDC  ,  . 
    2.	    RDC   Button. 
    3.	     btSave,   btLoad,   btSend. 
    4.      Caption    '&Save locally'  
btSave, 'sLoad local data'   btLoad  'Send changes to server'   btSend. 
    5.       ,     . 
    6.       btSave      
    OnClick. 
    ClientDataSetl.SaveToFile(':\TESTLOCAL.DAT'); 
    7.       btLoad      
    OnClick. 
    ClientDataSetl.LoadFromFile(':\TESTLOCAL.DAT'); 
    8.       btSend      
    OnClick. 
    ClientDataSetl.ApplyUpdates(0); 

    434	IV.    

    9.      . 
    10.      ,    btSave. 
    11.     RDB (  
)   .       
  Yes,    . 
    12.   RDC,  ,      
   .  -  ,   
 btSave,   . 
    13.   RDC    .    
    RDB.  ,   
  ,      . 
    14. _   ,    btLoad.  
   . 
    15.     ,    btSend.  
       ,  ,  
   ,       . 
  ,        
    ,      ,  
      . 

        

           Delphi  
      .  ,  
     ,    
 ,         . 
     ,    , 
  -"    "-".  , 
  ,  . 
    1.	  RDC,    . 
    2.	    TStatusBar.    
   . 
    3.	  Object Inspector   SimplePanel  
  True. 
    4.       DataSource,    Object Inspector 
    
    OnDataChange. 
    5.          . 

    With  DataSourcel.DataSet  do StatusBarl.SimpleText   := 
    Format('%d /  %d',[RecNo,RecordCount]); 

    6.      Object Inspector  5     
PacketRecords  ClientDataSet.  ,     
     .     
  -1,       .   
   0,       . 
    7.     .      ,  
,        .  
    ,     
      .    
,          
      . 

     . 22.1     RDC. 

     22.    	435 

    . 22.1. ,    ,    

     

         /  Delphi 
       .  
        
  .      
,      .   
     . 
     ,       
    , , ,   
   ,       
.         
           . 

     ... 

              
      ,    
   .     ,  Delphi  
     ,      
 . 

    436 IV.    
