
DbiDoRestructure ? (Pack a Paradox table)
Quote:
>I would like to pack a Paradox table at run time. I know that the command
>is DbiDoRestructure(), but I do not understand what goes inside the
>parenthesis. Can you help me out?
>Rick Dubbs
>Technology Coordinator
>Monore-Gregg School District
>Monrovia (near Indianapolis), Indiana, USA
Follow the Code...
{Function to Pack a Table}
function PackTable(tbl:TTable): Boolean;
var
crtd: CRTblDesc;
db: TDataBase;
begin
try
Screen.Cursor := crHourglass;
Result := True;
with tbl do
begin
db := DataBase;
If Active then
Active := False;
if not db.Connected then
db.Connected := True;
FillChar( crtd, SizeOf( CRTblDesc ), 0 );
StrPCopy( crtd.szTblName, TableName );
crtd.bPack := True;
nil, nil, False ) <> DBIERR_NONE then
Result := False;
Open;
end; {with}
except
on Exception do {any exception}
Result := False;
end; {try..except}
Screen.Cursor := crDefault;
end; {procedure}
This Works!
Carlos Alberto