C
chenxu
Unregistered / Unconfirmed
GUEST, unregistred user!
使用了两个ado控件:adotable1, adoquery1
两个ado控件的cursorlocation属性都设为clUseServer
datasoure1.dataset指向adoquery1,DBGrid1的datasource设为datasource1
执行如下代码:
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('create table temptable0 (tmp1 char(10), tmp2 char(20), tmp3 char(30))');
adoquery1.ExecSQL;
adotable1.TableName:= 'temptable0';
adotable1.Open;
for i:= 1 to 100 do
begin
adotable1.AppendRecord(['tmp' + inttostr(i), 'test' + inttostr(i), 'hello' + inttostr(i)]);
adotable1.Edit;
adotable1.UpdateRecord;
end;
adotable1.Close;
adoquery1.SQL.Clear;
adoquery1.sql.Add('select * from temptable0');
adoquery1.Open;
执行完代码后DBGrid1中显示为空,但能显示出字段名,没有数据,
要等待大约2秒后再执行'select * from temptable0'才有数据显示,
请问原因?
两个ado控件的cursorlocation属性都设为clUseServer
datasoure1.dataset指向adoquery1,DBGrid1的datasource设为datasource1
执行如下代码:
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('create table temptable0 (tmp1 char(10), tmp2 char(20), tmp3 char(30))');
adoquery1.ExecSQL;
adotable1.TableName:= 'temptable0';
adotable1.Open;
for i:= 1 to 100 do
begin
adotable1.AppendRecord(['tmp' + inttostr(i), 'test' + inttostr(i), 'hello' + inttostr(i)]);
adotable1.Edit;
adotable1.UpdateRecord;
end;
adotable1.Close;
adoquery1.SQL.Clear;
adoquery1.sql.Add('select * from temptable0');
adoquery1.Open;
执行完代码后DBGrid1中显示为空,但能显示出字段名,没有数据,
要等待大约2秒后再执行'select * from temptable0'才有数据显示,
请问原因?