Empty Table not the same DB desktop empty 
Author Message
 Empty Table not the same DB desktop empty

Hello,

I have noticed that ttable.emptytable seems to delete the records one at
a time, takes a long time with medium sized paradox database (30,000
records), and does not reduce the file size.  Using Database Desktop
Tools/Empty the action is almost instantaneous and the file is reduced
to the minimum size.  Is there any way to get the same results from a
delphi program?

TIA...Jim



Wed, 18 Jun 1902 08:00:00 GMT  
 Empty Table not the same DB desktop empty

Quote:
> I have noticed that ttable.emptytable seems to delete the records one at
> a time, takes a long time with medium sized paradox database (30,000
> records), and does not reduce the file size.  Using Database Desktop
> Tools/Empty the action is almost instantaneous and the file is reduced
> to the minimum size.  Is there any way to get the same results from a
> delphi program?

I don't have an exact answer (as I can't see what DD is actually doing
internally) but my guess would be that DD is actually calling
TTable.CreateTable (or the BDE's dbiCreateTable) with the same field and
index properties of the existing table, essentially "re-creating" it.  That
is:

(1) Get current table structure(s) including field defs, index defs, etc.
(2) Delete current table.
(3) Create new table using this structure information.

I would imagine this would be very fast.

Regards,
Vinnie Murdico
Software with Brains, Inc.
Value-Priced Bug-Tracking Software
http://www.softwarewithbrains.com



Mon, 14 Apr 2003 08:31:51 GMT  
 Empty Table not the same DB desktop empty
: I have noticed that ttable.emptytable seems to delete the records one at
: a time, takes a long time with medium sized paradox database (30,000
: records), and does not reduce the file size.  Using Database Desktop
: Tools/Empty the action is almost instantaneous and the file is reduced
: to the minimum size.  Is there any way to get the same results from a
: delphi program?

As far as reducing the file size, follow the call to empty the table
with a call to pack the table.  This, however, involves API calls to
the BDE.  More info on how to do the API calls, and a "pack table"
component, are available at Borland's website.  As to the time issue,
I'm not sure, but you could experiment with whether using a BDE API
call to empty the table is faster. Borland's been moving their web
pages around, but you may still be able to get there from
http://www.borland.com/devsupport/bde/

There are also a lot of enhanced components and library routines to
make the most efficient use of the BDE in the freeware rxLib component
library, which comes with full source code.  http://www.rxlib.com/

Let us know if you find a more efficient way.
--
Rick Carter



Mon, 14 Apr 2003 08:25:57 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Turbo visions empty desktop detection ??

2. Turbo visions empty desktop detection ??

3. Desktop Empty errors

4. Empty Table - Table in use

5. Creating Empty Table with Structure of existing table

6. How to empty an Tdate db field?

7. Empty field not reported as NULL

8. db alias not showing up in db desktop

9. [Access97] - Empty Msater-Detail is not working fine

10. DElphi 3 paradox table empty fields Variant Conversion error

11. filling an empty table with results from TClientDataset.savetofile

12. DELPHI: BDE Empty Table Error

 

 
Powered by phpBB® Forum Software