Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Trucos (https://www.clubdelphi.com/foros/forumdisplay.php?f=52)
-   -   Pack en tablas Paradox (https://www.clubdelphi.com/foros/showthread.php?t=80681)

dec 01-07-2006 01:02:49

Pack en tablas Paradox
 
Pack en tablas Paradox

(Obtenido de La Cara Oculta de Delphi de Ian Martees)

Hay que recordar poner en Uses BDE.

Código Delphi [-]
var
  PxStruct: CRTblDesc;
  db:TDataBase;
begin
  with TTable.Create(Self) do
  try
    DatabaseName := 'Nombre_alias';
    TableName := 'Nombre_Tabla.db';
    Exclusive := True;
    Open;
    Db := Session.FindDatabase('Nombre_alias');
    Db.KeepConnection := True;
    Close;
    FillChar(PxStruct, SizeOf(PxStruct), 0);
    StrPCopy(PxStruct.szTblName, 'Nombre_Tabla.db');
    PxStruct.bPack := True;
    if DbiDoRestructure(Db.Handle, 1, @PxStruct, nil, nil, nil, False)<> DBIERR_NONE
       then raise EDatabaseError.Create('Error en tabla');
    Db.Connected := False;
  finally
    Free;
  end;
end;


La franja horaria es GMT +2. Ahora son las 16:53:48.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi