Solved

Delphi Programming question

Posted on 1997-09-24
2
157 Views
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.

Thanks!
Erik N
0
Comment
Question by:Erik N
[X]
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
2 Comments
 
LVL 2

Accepted Solution

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

  function PackTable(table:TTable; db:TDatabase):DBIResult;
  var
    crtd: CRTblDesc;
  begin
    Result := DBIERR_NA;
    with table do if Active then Active := False;
    with db do if not Connected then Connected := True;
    FillChar(crtd,SizeOf(CRTblDesc),0);
    StrPCopy(crtd.szTblName,table.TableName);
    crtd.bPack := True;
    Result := DbiDoRestructure(db.Handle,1,@crtd,nil,nil,nil,FALSE);
  end;

Example of use:

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

Author Comment

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

636 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