Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help needed.

1 view
Skip to first unread message

Martin

unread,
Feb 25, 2003, 12:05:17 PM2/25/03
to
Hi all,
could someone tell me why this procedure is not working correctly?
It's not deleting all the records it's supposed to.
Thanks.

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;

John Herbster (TeamB)

unread,
Feb 25, 2003, 1:29:23 PM2/25/03
to
Martin, I just answered this post somewhere else -- non-tech,
I think. Please do not multipost. Do a little googling in Google
Groups to find out where similar
--
Regards, JohnH (TeamB)
Borland bug status and reporting: http://qc.borland.com/
QC discussion is in newsgroup "borland.public.community".
Newsgroup list & guidelines: http://info.borland.com/newsgroups/


Jomad

unread,
Feb 25, 2003, 3:49:44 PM2/25/03
to
Hi Martin,

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...

0 new messages