标签:procedure windows private public
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExcelWithOdbc, StdCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Button1: TButton;
ExcelWithOdbc1: TExcelWithOdbc;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOQuery1.Close;
ADOQuery1.SQL.Add(‘SELECT TOP 100 * FROM T1‘);
ADOQuery1.Active := True;
with ExcelWithOdbc1 do
begin
DataItems.Add;
AutoGetFileName := true ;
AutoOpen := True ;
DataItems.Items[0].DataSet := adoquery1 ;
DataItems.Items[0].OnlySelect := false ;
DataItems.Items[0].SelectFields := false ;
DataItems.Items[0].SheetName := ‘100条数据;
Execute;
end;
end;
end.
本文出自 “畅想天空” 博客,请务必保留此出处http://kinwar.blog.51cto.com/3723399/1615468
标签:procedure windows private public
原文地址:http://kinwar.blog.51cto.com/3723399/1615468