Ver Mensaje Individual
  #5  
Antiguo 20-04-2006
h2o_mx h2o_mx is offline
Miembro
 
Registrado: ago 2005
Posts: 17
Reputación: 0
h2o_mx Va por buen camino
saludos de nuevo amigos, tengo el siguiente codigo
que me diste en el link

Código Delphi [-]
procedure PackTable(TblName : String);var  tbl     : TTable;  cProps  : CURProps;  hDb     : hDBIDb;  TblDesc : CRTblDesc;begin  tbl := TTable.Create(nil);  with tbl do begin    Active := False;    DatabaseName := ExtractFilePath(TblName);    TableName := ExtractFileName(TblName);    Exclusive := True;    Open;  end;  // Added 23/7/2000 to make sure that the current path is the same as the table  //see note below  SetCurrentDir(ExtractFilePath(TblName));  // Make sure the table is open exclusively so we can get the db handle...  if not tbl.Active then    raise EDatabaseError.Create('Table must be opened to pack');  if not tbl.Exclusive then    raise EDatabaseError.Create('Table must be opened exclusively to pack');  // Get the table properties to determine table type...  Check(DbiGetCursorProps(tbl.Handle, cProps));  // If the table is a Paradox table, you must call DbiDoRestructure...  if (cProps.szTableType = szPARADOX) then    begin      // Blank out the structure...      FillChar(TblDesc, sizeof(TblDesc), 0);      // Get the database handle from the table's cursor handle...      Check(DbiGetObjFromObj(hDBIObj(tbl.Handle), objDATABASE, hDBIObj(hDb)));      // Put the table name in the table descriptor...      StrPCopy(TblDesc.szTblName, tbl.TableName);      // Put the table type in the table descriptor...      StrPCopy(TblDesc.szTblType, cProps.szTableType);      // Set the Pack option in the table descriptor to TRUE...      TblDesc.bPack := True;      // Close the table so the restructure can complete...      tbl.Close;      // Call DbiDoRestructure...      Check(DbiDoRestructure(hDb, 1, @TblDesc, nil, nil, nil, False));    end  else    // If the table is a dBASE table, simply call DbiPackTable...    if (cProps.szTableType = szDBASE) then      Check(DbiPackTable(tbl.DBHandle, tbl.Handle, nil, szDBASE, True))    else      // Pack only works on Paradox or dBASE; nothing else...      raise EDatabaseError.Create('You can only pack Paradox or dBase tables!');  with tbl do begin    if Active then      Close;    Free;  end;end;

pero en las variables
var
tbl : TTable;
cProps : CURProps;
hDb : hDBIDb;
TblDesc : CRTblDesc;
no reconoce CURProps, ni hDBIDb, ni CRTblDesc, disculpa
mi ignorancia , pero tengo que incluir una libreria
o un type? gracias, por lo visto a esta funcion solo le mando
la tabla y ya verdad? osea la mando llamar como:

PackTable('c:\tablas\aquiesta.db'); ????

Thanks!!!
Responder Con Cita