My second problem is the speed with which these records are added to the
table. ARe there any special techniques to improve on the loading
speed, especially the blob fields. Currently I use a
LoadFromFile/SaveToFile property but this seems very inefficient. Some
help will be appreciated.
Bennie
Bennie Coetzer wrote in message <351205...@thales.co.za>...
[...]
>more disk space. I can manually pack the table using the Restructure
>utility which does result in the desired effect but I need an automatic
>mechanism.
[...]
>Bennie
The primary index of a Paradox table is a clustered index. If you delete a
record the space occupied by that record is now available. If you add a new
record and the primary key value of the new record causes it to reside in
the same block that has free space from a previously deleted record that
free space will be used for the new record. If you delete records with
random primary keys and add records with random primary keys your database
will grow to a point where most of the blocks have some free space and from
then on growth will be very slow because most new records will find existing
space to reuse.
To pack a Paradox table use the following.
function dgPackParadoxTable(Tbl: TTable; Db: TDatabase):DBIResult;
{Packs a Paradox table by calling the BDE
DbiDoRestruct function. The TTable passed as the
first parameter must be closed. The TDatabase passed
as the second parameter must be connected.}
var
TblDesc: CRTblDesc;
begin
Result := DBIERR_NA;
FillChar(TblDesc, SizeOf(CRTblDesc), 0);
StrPCopy(TblDesc.szTblName, Tbl.TableName);
TblDesc.bPack := True;
Result := DbiDoRestructure(Db.Handle, 1, @TblDesc, nil, nil, nil, False);
end;
--
Bill
(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)