不是很复杂的,只是循环而已 var i:integer; b:boolean; begin ...... b:=true; adoquery1.open; adoquery2.open; while (not adoquery1.eof) and b do begin for i:=0 to adoquery1.FieldCount-1 do if adoqWeb.Fields[i].Value <>adoquery2.FieldByName(adoquery1.Fields [i].FieldName).Value then b:=false adoquery1.next; adoquery2.next end; if b=false then showmessage('数据不同') else showmessage('数据相同') end;
逐个比较每个字段!
var
i:integer;
b:boolean;
begin
......
b:=true;
adoquery1.open;
adoquery2.open;
while (not adoquery1.eof) and b do
begin
for i:=0 to adoquery1.FieldCount-1 do
if adoqWeb.Fields[i].Value <>adoquery2.FieldByName(adoquery1.Fields [i].FieldName).Value then b:=false
adoquery1.next;
adoquery2.next
end;
if b=false then showmessage('数据不同') else showmessage('数据相同')
end;