对查询(select name,shortname,shortname from namelist)先做假删除,然后假赋值,即不改变原数据数据,下面的做法有什么不对吗?其他有什么好方法没有?谢了!
while not Query_Short.Eof do
Query_Short.delete;
for i:=1 to StringGrid.RowCount-1 do
begin
Query_Short.Fields[0].AsString:=StringGrid.Cells[0,i];
Query_Short.Fields[1].AsString:=StringGrid.Cells[1,i];
Query_Short.Fields[2].AsString:=StringGrid.Cells[2,i];
end;
while not Query_Short.Eof do
Query_Short.delete;
for i:=1 to StringGrid.RowCount-1 do
begin
Query_Short.Fields[0].AsString:=StringGrid.Cells[0,i];
Query_Short.Fields[1].AsString:=StringGrid.Cells[1,i];
Query_Short.Fields[2].AsString:=StringGrid.Cells[2,i];
end;
我把它放在for循环里作为begin后的第一条语句,但这样似乎因为没有post而不行。
高手们,指点指点吧!
因为我要生成报表(用fastreport),用这个查询做报表的数据,直接从数据库查询得到的不合要求,所以先做假删除,然后假赋值。
while not Query_Short.Eof do
Query_Short.delete;
会出问题吧?记得运行时出错信息为“键列值”的问题,唉,不懂
谢谢大家!