Page 1 of 1

How to empty a Table?

Posted: 12.07.2013, 22:38
by IbeDBob
Hi, did some searching here and nothing helps. Read the Help system, same.

tblFiles.EmptyDataSet;

Sometimes it shows tblFiles.RecordCount as = to 0 and other times it does not.

I need to re-use a temporary Table 30-times per run of my application and I need to empty it before EVERY use.

I also tried an SQLQuery
DELETE * FROM tblFiles and it didn't like the *

Tried
DELETE FROM tblFiles and it did nothing.

Posted: 13.07.2013, 10:54
by marsupilami
Hello IbeDBob,

what kind of database do you use? Could you post some sourcecode on how you try to do it? Normally something like this should work:

Code: Select all

ZConnection.Close;
ZConnection.SQL.Text := 'DELETE FROM tblFiles';
ZConnection.ExecSQL;
Best regards,

Jan