Var i:integer; begin i:=0; adodataset6.first; while not adodataset6.Eof do begin i:= i adodataset6.FieldByName('total').value; adodataset6.next; end; Showmessage(inttostr(i));