有关于Tquery缓存复制的问题?(100分)

  • 主题发起人 主题发起人 spits
  • 开始时间 开始时间
S

spits

Unregistered / Unconfirmed
GUEST, unregistred user!
在多层架构中,可用TClientDateSet1.AppendData(TClientDateSet2.data,False)把
TClientDateSet2缓存中的数据加入TClientDateSet1中。

不知在Tquery中有何方法实现以上功能,谢谢!
 
》》不知在Tquery中有何方法实现以上功能,
用CACHEDUPDATE,加入数据只能自己写了一个函数了
 
没有方法.
 
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;
 
To:arm谢谢你的方法.
 
接受答案了.
 
后退
顶部