home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Cell Control / DATA1.CAB / DELPHIDM / UFile.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-01-11  |  1.4 KB  |  60 lines

  1. unit UFile;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Tempunit, ComCtrls, StdCtrls, Buttons, OleCtrls, CELLLib_TLB, ExtCtrls;
  8.  
  9. type
  10.   TFFile = class(TTemplate)
  11.     BitBtn2: TBitBtn;
  12.     BitBtn3: TBitBtn;
  13.     procedure BitBtn2Click(Sender: TObject);
  14.     procedure BitBtn3Click(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   FFile: TFFile;
  23.  
  24. implementation
  25.  
  26. {$R *.DFM}
  27.  
  28. procedure TFFile.BitBtn2Click(Sender: TObject);
  29. Var
  30.   TablesNames : OleVariant;
  31.   a, b  :  OleVariant;
  32. begin
  33.   inherited;
  34.      try
  35.     {     if  cell1.DoOpenFileDbase(1, ExtractFileDir(Application.ExeName)+'Sample.mdb', TablesNames) = true then
  36.     }
  37.         if  cell1.DoOpenFileDbase(0, ExtractFileDir(Application.ExeName)+'\Sample.mdb', TablesNames) = true then
  38.         begin
  39.             ;
  40.             cell1.DoDumpDbaseTable('sample',0, 0, 0, true, a, b);
  41.             ;
  42.          end else
  43.          begin
  44.             MessageDlg('Open file failure, please check file Sample.mdb.', mtInformation,[mbOk], 0);
  45.          end;
  46.      except
  47.             MessageDlg('Open file failure, please check file Sample.mdb.', mtInformation,[mbOk], 0);
  48.      end;
  49. end;
  50.  
  51. procedure TFFile.BitBtn3Click(Sender: TObject);
  52. begin
  53.   inherited;
  54.          ;
  55.          MessageDlg('This function need ODBC support.', mtInformation,[mbOk], 0);
  56.          ;
  57. end;
  58.  
  59. end.
  60.