Z
zh_2001
Unregistered / Unconfirmed
GUEST, unregistred user!
当我执行如下代码是出现错误:
procedure TForm1.Button1Click(Sender: TObject);
begin
with query2 do
begin
edit;
insert;
close;
SQL.clear;
SQL.Add('insert into show128_sql(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s13,s15,s16,s17,s18,s19,s21,s22,s23,s24,s25) select * from show128_sql_temp');
SQL.Add('update show128_sql set s0=getdate()');
execSQL;
post;
open;
end;
end;
错误是:query2: dataset not in edit or insrt mode
怎么回事?
怎么设置才能插入、更新表?
procedure TForm1.Button1Click(Sender: TObject);
begin
with query2 do
begin
edit;
insert;
close;
SQL.clear;
SQL.Add('insert into show128_sql(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s13,s15,s16,s17,s18,s19,s21,s22,s23,s24,s25) select * from show128_sql_temp');
SQL.Add('update show128_sql set s0=getdate()');
execSQL;
post;
open;
end;
end;
错误是:query2: dataset not in edit or insrt mode
怎么回事?
怎么设置才能插入、更新表?