dfm 文件
object Form1: TForm1
Left = 173
Top = 123
Width = 544
Height = 375
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 328
Top = 0
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
OnClick = Button1Click
end
object DBGrid1: TDBGrid
Left = 48
Top = 64
Width = 320
Height = 120
DataSource = DataSource1
TabOrder = 1
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = []
end
object Query1: TQuery
Active = True
CachedUpdates = True
DatabaseName = 'DBDEMOS'
RequestLive = True
SQL.Strings = (
'SELECT * FROM ORDERS'
'WHERE 1<>1')
Left = 8
Top = 8
end
object Query2: TQuery
Active = True
DatabaseName = 'DBDEMOS'
SQL.Strings = (
'SELECT * FROM ORDERS')
Left = 56
Top = 8
end
object DataSource1: TDataSource
DataSet = Query1
Left = 104
Top = 8
end
end
procedure TForm1.AddData(Des, Src: TQuery);
var
i:integer;
begin
with Src do
begin
first;
while not Eof do
begin
des.Edit;
des.Append;
for i:=0 to fieldcount-1 do
des.Fields.asvariant:=Fields.asvariant;
des.Post;
next;
end;
end;
end;