JetImportExportU1.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit JetImportExportU1;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, DB, ADODB, ExtCtrls, Grids, DBGrids;
  6. type
  7.   TForm1 = class(TForm)
  8.     ADOConnection1: TADOConnection;
  9.     Button1: TButton;
  10.     Button2: TButton;
  11.     Button3: TButton;
  12.     ADOTable1: TADOTable;
  13.     DataSource1: TDataSource;
  14.     DBGrid1: TDBGrid;
  15.     Panel1: TPanel;
  16.     Button4: TButton;
  17.     procedure Button1Click(Sender: TObject);
  18.     procedure Button2Click(Sender: TObject);
  19.     procedure Button3Click(Sender: TObject);
  20.     procedure Button4Click(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26. var
  27.   Form1: TForm1;
  28. implementation
  29. {$R *.dfm}
  30. procedure TForm1.Button1Click(Sender: TObject);
  31. begin
  32.   ADOConnection1.Execute(
  33.   'SELECT * INTO Customers IN "C:Temp" "Paradox 7.x;" FROM CUSTOMERS');
  34. end;
  35. procedure TForm1.Button2Click(Sender: TObject);
  36. begin
  37.   ADOConnection1.Execute(
  38.   'SELECT * INTO Customers IN "C:TempNorthwind.xls" "Excel 8.0;" FROM CUSTOMERS');
  39. end;
  40. procedure TForm1.Button3Click(Sender: TObject);
  41. begin
  42.   ADOConnection1.Execute(
  43.   'SELECT * INTO [Customers.htm] IN "C:Temp" "HTML Export;" FROM CUSTOMERS');
  44. end;
  45. procedure TForm1.Button4Click(Sender: TObject);
  46. begin
  47.   ADOTable1.Open;
  48. end;
  49. end.