Product:        VCL Component (TDbCheck)
Author:         Markelov Vladimir & Momot Alexander
E-Mail:         v_matroskin@aport2000.ru
Status:         FreeWare
Delphi:         Delphi 5

              -
    (DBASE, PARADOX) 
( ..    ).  -
     Delphi(   3)  -
   Borland Database Engine(BDE).
         FREEWARE      FREEWARE
    (    ,
    ).   -  
  ,     
       .

{------------------------------------------------------------}
           ():
{------------------------------------------------------------}

1.   (     ).
2.    (  ).
3.  ().
4.   .
5.     .
6.  ().
6.   .
7.   .
8.     .
9.     Index out of date.
10.    Key Violation.

{------------------------------------------------------------}
           , :
{------------------------------------------------------------}

1.       .
2.   ReadPath  ,   -
          .
       (alias).  
       (Design-time).
3.   ReadFiles   , -
        .  
           
       .     
      ,    
      . ,  ReadFiles
      :
        JOURNAL.DB= 
        MAIN.DB=  
        SCHET.DB= 
   !     , .. 
    ,       
        ReadPath .
4.  CorrectPath,      
      ,     
   ,      (* alias)-
   .     , ,
     OnCreate   , 
      .
5.    (design-time),  -
         TDbCheck   
    'Read database structure...',    
          Descriptor.
         . 
           .
   ,     ,  
           
     .
6.    .    
     OnCreate   . :

    procedure TMainForm.FormCreate(Sender: TObject);
    begin
     {  
     DbCheck1.CorrectPath := ExtractFilePath(Application.ExeName);
     }
     DbCheck1.CheckDatabase;
    end;

       OnFoundDiff , 
          
    ,    Descriptor:

    procedure TForm1.DbCheck1FoundDiff(Sender: TObject;
      ChkMessage: TChkMessage; TblName: String; var Correct: Boolean);
    begin
      case( ChkMessage )of
      CHK_TABLECREATE:
       Correct := MessageBox(Handle, PChar(Format(' "%s"  .  ?',
                             [TblName])), '', MB_YESNOCANCEL or MB_ICONWARNING) = ID_YES;
      CHK_TABLEMODIFY:
       Correct := MessageBox(Handle, PChar(Format('    "%s".  ?',
                             [TblName])), '', MB_YESNOCANCEL or MB_ICONWARNING) = ID_YES;
      end;{ CASE }
    end;

   :
   ChkMessage    :
    CHK_TABLECREATE -        ;
    CHK_TABLEMODIFY -      
                       .

   TblName -     ,   ,
                ReadFiles    
               (=).

   Correct -     True  
                   .

           . :

    procedure TMainForm.DbCheck1FoundDiff(Sender: TObject;
      ChkMessage: TChkMessage; TblName: String; var Correct: Boolean);
    var
     RetCode: Longint;
    begin
      case( ChkMessage )of
      CHK_TABLECREATE:
       RetCode := MessageBox(Handle, PChar(Format(' "%s"  .  ?',
                             [TblName])), '', MB_YESNOCANCEL or MB_ICONWARNING);
      CHK_TABLEMODIFY:
       RetCode := MessageBox(Handle, PChar(Format('    "%s".  ?',
                             [TblName])), '', MB_YESNOCANCEL or MB_ICONWARNING);
      end;{ CASE }
       Correct := (RetCode = ID_YES);

      if( Correct )then
      with( ABForm )do //  - 
      begin
       case( ChkMessage )of
       CHK_TABLECREATE: LABEL_PROC.Caption := Format('  %s...',[TblName]);
       CHK_TABLEMODIFY: LABEL_PROC.Caption := Format('  %s...',[TblName]);
       end;{ CASE }
       LABEL_PROC.Refresh;
      end;{ IF }
    end;

           
     OnBeforeCheck, :

    procedure TMainForm.DbCheck1BeforeCheck(Sender: TObject;
      ChkMessage: TChkMessage; TblName: String);
    begin
      case( ChkMessage )of
      CHK_NONE: ABForm.LABEL_PROC.Caption := Format('  %s...',[TblName]);
      CHK_AUTOINCREPAIR: ABForm.LABEL_PROC.Caption := Format('   %s...',[TblName]);
      end;{ case }
      ABForm.LABEL_PROC.Refresh;
    end;

          OnError,
   :

    procedure TMainForm.DbCheck1Error(Sender: TObject; Message: EDBEngineError);
    begin
     MessageBox(Handle, PChar(Format('[] %s', [Message.Message])), '', MB_OK or MB_ICONERROR);
    end;


               
    :

        OnAddField  OnModifyField

    procedure TMainForm.DbCheck1OnAddField(Sender: TObject; TblName, FldName: String);
    begin
     MessageBox(Handle, PChar(Format('  %s   %s', [FldName, TblName])), '', MB_OK or MB_ICONWARNING);
    end;

         OnCreateTable:

    procedure TMainForm.DbCheck1OnCreateTable(Sender: TObject; TblName: String);
    begin
     MessageBox(Handle, PChar(Format('  - %s', [TblName])), '', MB_OK or MB_ICONINFORMATION);
    end;

         OnModifyTable:

    procedure TMainForm.DbCheck1OnModifyTable(Sender: TObject; TblName: String);
    begin
     MessageBox(Handle, PChar(Format('  - %s', [TblName])), '', MB_OK or MB_ICONINFORMATION);
    end;


7. !         
      .  .
        DsgnIntf  Masks;
          .     Delphi 5.

{------------------------------------------------------------}
         
{------------------------------------------------------------}

            . 
        c  2000   -
        .

{------------------------------------------------------------}
          
{------------------------------------------------------------}

            Database Workshop  
       . Database Workshop  
           
     : Database Desktop, BDE Administrator, SQL Explorer,
    Datapump,      
       .

             , 
     .   . !

    ,     
        v_matroskin@aport2000.ru

         ,  
          
     .

         