Pack

Delphi

25/03/2003

Quando tento dar pack em uma tabela com o comando tabela.pack, ele da o seguinte erro:
Pack requires full acces to file: D:\...\tabela.dbf.
Estou usando um componente chamado Halcyon para acessar tabelas dbf´s, e na hora em que dou o comando .pack a tabela esta aberta.
O que devo fazer???

Agradeço desde já.


Inutaishou

Inutaishou

Curtidas 0

Respostas

Aroldo Zanela

Aroldo Zanela

25/03/2003

Quando tento dar pack em uma tabela com o comando tabela.pack, ele da o seguinte erro: Pack requires full acces to file: D:\...\tabela.dbf. Estou usando um componente chamado Halcyon para acessar tabelas dbf´s, e na hora em que dou o comando .pack a tabela esta aberta. O que devo fazer??? Agradeço desde já.

Colega,
Verifique se você tem direito de escrita para o caminho d:\... e se você está em modo exclusivo.

O seguinte artigo explica como fazer isso por meio do BDE:

community.borland.com

Article #15998: packing a dBASE table

Technical Information Database

TI998D.txt packing a dBASE table
Category :Database Programming
Platform :All
Product :Delphi All

Description:
packing a dBASE table

Q: How do I pack a dBASE table?

A: To pack a dBASE table that has been opened with a TTable,
use the BDE function DbiPackTable. There are two basic steps
to do this:

1. Add the following units to your uses clause:

{ For Delphi 1.0: } DBITYPES, DBIPROCS and DBIERRS;
{ For Delphi 2.0: } BDE;

2) Then call the DbiPackTable BDE function as follows:

Check(DbiPackTable(Table1.DbHandle, Table1.Handle, Nil, szDBASE, TRUE));

Notes:
* The table must be opened in exclusive mode.
* Use the Check procedure when calling BDE API functions. Check
will raise an exception if an error occurs on the BDE call.



Reference:


7/16/98 4:33:58 PM

Last Modified: 01-SEP-99


GOSTEI 0
POSTAR