L
lcy_1983
Unregistered / Unconfirmed
GUEST, unregistred user!
我进了一个临时表#temptable,在临时表里增加一列flag...然后每访问一行临时表的数据,对flag 设一个标志. 但语句运行没问题,但就是flag里没数值.
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add(str3);
SQL.Add('alter table #temptable add flag char(2) null');
SQL.Add('select * from #temptable');
Open;
ProgressBar1.Max:=RecordCount;
First;
Panel1.Caption:='正在对进行数据分析,请稍候......';
Panel1.Refresh;
while not Eof do
begin
if 1=addressfx(FieldByName('a_'+Editcol01.Text+'').Value,FieldByName('b_'+Editcol001.Text+'').Value) then
begin
ADOQuery1.Edit;
ADOQuery1.FieldValues['flag']:='1';
ADOQuery1.Post;
end
else
begin
ADOQuery1.Edit;
ADOQuery1.FieldValues['flag']:='0';
ADOQuery1.Post;
end;
next;
ProgressBar1.Visible:=true;
ProgressBar1.Position:=ProgressBar1.Position+1;
end;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from #temptable');
ADOQuery1.Open;
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add(str3);
SQL.Add('alter table #temptable add flag char(2) null');
SQL.Add('select * from #temptable');
Open;
ProgressBar1.Max:=RecordCount;
First;
Panel1.Caption:='正在对进行数据分析,请稍候......';
Panel1.Refresh;
while not Eof do
begin
if 1=addressfx(FieldByName('a_'+Editcol01.Text+'').Value,FieldByName('b_'+Editcol001.Text+'').Value) then
begin
ADOQuery1.Edit;
ADOQuery1.FieldValues['flag']:='1';
ADOQuery1.Post;
end
else
begin
ADOQuery1.Edit;
ADOQuery1.FieldValues['flag']:='0';
ADOQuery1.Post;
end;
next;
ProgressBar1.Visible:=true;
ProgressBar1.Position:=ProgressBar1.Position+1;
end;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from #temptable');
ADOQuery1.Open;