Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Tablas planas
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 20-04-2006
h2o_mx h2o_mx is offline
Miembro
 
Registrado: ago 2005
Posts: 17
Poder: 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
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Compactar Base de Datos Paradox jdangosto Conexión con bases de datos 3 02-08-2005 18:34:57
como puedo compactar una base de datos mdb? viajero2015 Conexión con bases de datos 5 08-12-2004 19:28:58
compactar AbcXxx Firebird e Interbase 6 07-07-2003 10:15:30
Compactar e indexar en Paradox chozas Tablas planas 0 20-05-2003 20:21:12
Paradox e Interbase, como hago para transportar todo lo de paradox a Interbase Fatima Gonzalez Firebird e Interbase 2 05-05-2003 18:02:30


La franja horaria es GMT +2. Ahora son las 00:09:51.


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