Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Delphi Programming question

Posted on 1997-09-24
Medium Priority
Last Modified: 2010-04-04
I would like to "Pack" my paradox-table at run-time. By packing I am refering to deleting empty records. In the Database Desktop you can do this when selecting "Restructure", but I want this to be automatic within my application.

I use Delphi Developer 2.0.

Erik N
Question by:Erik N
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Waldek earned 0 total points
ID: 1346161
Try this
  uses  DBIProcs, DBITypes, DBIErrs;

  function PackTable(table:TTable; db:TDatabase):DBIResult;
    crtd: CRTblDesc;
    Result := DBIERR_NA;
    with table do if Active then Active := False;
    with db do if not Connected then Connected := True;
    crtd.bPack := True;
    Result := DbiDoRestructure(db.Handle,1,@crtd,nil,nil,nil,FALSE);

Example of use:

  procedure TForm1.Button1Click(Sender: TObject);
    if PackTable(Table1,DataBase1) = DBIERR_NONE then .....
    else MessageBeep(0);

Author Comment

by:Erik N
ID: 1346162
Good help there Waldek. Thanx!
Erik N.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question