procedure TClearKeeper.ClearNames;
var
strQuote : string;
begin
strQuote := '''';
with dm.ctable2 do
begin
indexname := 'INDEX3';
refresh;
first;
while not EOF do
begin
if (fieldbyname('kind').asstring = 'K') and
(fieldbyname('date').asdatetime =
strtodate(edtDate.Text)) then
begin
ProcessingDlg.ShowMessage('Processing ' +
fieldbyname('number').asstring);
dm.TempQuery.sql.clear;
dm.TempQuery.sql.add('delete from cptable');
dm.TempQuery.sql.add('where number = ' + strQuote +
fieldbyname('number').asstring + strQuote);
dm.TempQuery.ExecSql;
end;
next;
end;
end;
end;
end;
Normaly the Delete procedure after delete gets the position on the next
record...so if u do next u allways leave records behind...try 2 take of the
next statment in the while cycle... don't forget to check the recordcount
otherwise u get an AV for deleting a table without records...
rgds
"Martin" <martin_maxwel79@hotmail.#com#> wrote in message
news:3e5ba1cb$1...@newsgroups.borland.com...