Board index » delphi » How to Pack a Database File (Paradox Format) in Delphi 1.0
Kenneth Lee
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Kenneth Lee
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
How to Pack a Database File (Paradox Format) in Delphi 1.0I would like to know can I pack a database file which is Paradox format |
Jim McCull
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to Pack a Database File (Paradox Format) in Delphi 1.0Ken, Try something like the code below. This was extracted from the Hope this helps you get started. Call the following routine like: if (DBPackTable('c:\tmp\', 'mytable.db'. '') then uses BDE; function DBPackTable(strDataBase, strTableName, strPassword: String): try StrPCopy(TblDesc.szTblName, strTableName); { set password information } { Set Flag to pack table } { Do a Restructure, this will pack the table without making finally { Close the database object } Jim McCullin On Tue, 30 Sep 1997 18:16:01 +0800, Kenneth Lee <sk...@hkstar.com> Quote>I would like to know can I pack a database file which is Paradox format |
Heiko Lüttg
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to Pack a Database File (Paradox Format) in Delphi 1.0There's no need to pack Paradox tables just liek DBase. Heiko Kenneth Lee <sk...@hkstar.com> schrieb im Beitrag Quote> I would like to know can I pack a database file which is Paradox format |
Andrew Gab
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to Pack a Database File (Paradox Format) in Delphi 1.0QuoteKenneth Lee wrote: {------------------------------------------------------------- PACK_TABLE -} { Pack (ie compress) a table and optionally encrypt it. It must be closed and not in use. Pword is the password for the table, if any.} procedure Pack_Table (TT : Ttable; const Pword : Str80); var TblDesc : CRTblDesc; hDb : hDbiDb; {handle to the DB} Tname : Str100; begin Tname := TT.DatabaseName + '\' + TT.TableName; if pos('.',Tname) = 0 then Tname := Tname + '.DB'; fillChar (TblDesc, SizeOf(CRTblDesc), 0); with TblDesc do begin strPCopy (szTblName, Tname); bPack := true; if Pword <> '' then begin {encrypt as well} strPcopy (szPassword, Pword); bProtected := true; end; end; hDb := nil; Dbi(DbiOpenDatabase (nil, 'STANDARD', dbiReadWrite, dbiOpenExcl, nil, 0, nil, nil, hDb)); {get a DB handle} Dbi(DbiDoRestructure (hDb, 1, @TblDesc, nil, nil, nil, FALSE)); {reconstruct the table} Dbi(DbiCloseDatabase (hDb)); {release the handle} end; {Pack_Table} -- |
Ian Parentea
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to Pack a Database File (Paradox Format) in Delphi 1.0QuoteHeiko Lttge wrote: Primary Key you can trick delphi into packing the table. Simply: Table.Addindex( '', 'Field Name', [] ); Notice the relatively small size of your primary key table? They are The value of the primary key for the first record in each block is OK OK Adding the pk index forces the BDE to rewrite the entire paradox table If the PK table exists don't be concerned Delphi lets you add it anyway. Garry Kernan |
1. Paradox db Pack in Delphi 1.0
2. Packing Database using Delphi 1.0?
3. how to pack a paradox database file?
4. Creating an index file for a Paradox 5.0 db file in Delphi 1.0
5. Maintaining/Packing database (Paradox) Files
6. need help / advice on a delphi 1.0 and paradox 5 multi user database
7. Help - Databases Problem (Paradox 5.0 + Delphi 1.0)
8. Table pack error (was: packing a database [delphi])