Board index » delphi » Reducing Database filesize ???

Reducing Database filesize ???

Hello,

I'm working with a Paradox DBase in Delhpi 3. No SQL or ODBC. When I put a
lot of records in the file and then delete almost all of them, the filesize
does not decrease ?
Why is that ?

Please help.
Thanks in advance.

 

Re:Reducing Database filesize ???


Quote
E. A. Voogt wrote:

> Hello,

> I'm working with a Paradox DBase in Delhpi 3. No SQL or ODBC. When I put a
> lot of records in the file and then delete almost all of them, the filesize
> does not decrease ?
> Why is that ?

> Please help.
> Thanks in advance.

 Even though records have been deleted, the allocated space remains. You
must do a repack to recover the unused space.

Robin

Re:Reducing Database filesize ???


Quote
E. A. Voogt wrote in message <01bd6561$f1ef8040$824797c2@eavoogt>...
>Hello,

>I'm working with a Paradox DBase in Delhpi 3. No SQL or ODBC. When I put a
>lot of records in the file and then delete almost all of them, the filesize
>does not decrease ?
>Why is that ?

>Please help.
>Thanks in advance.

Hi!

You need to Pack the table. You can do this manually by using the Database
Desktop. In Database Desktop, select Table|Restructure In the Restructure
Table dialog box you should see an option marked Pack Table. Check this
option then click Save. If everything has worked you should now see that
your database is smaller.

This method is fine, if you very rarely perform operations that remove large
amounts of data from a table such as deleting records, and you can get away
with the manual process of packing the table. If you want to automatically
pack a table after such operations from within your own Delphi applications
then you will need to call one of the BDE's functions. The function you need
is called dbiDoRestructure which is documented in the BDE32.HLP file which
can be found in your BDE folder. Note that there is also a function called
dbiPackTable but this is for dBase and FoxPro tables only.

Hope this helps

Kevin Parsons.

Other Threads