求助:delphi中如何对DBASE数据库实现PACK与REINDEX操作 (100分)

  • 主题发起人 主题发起人 GWW
  • 开始时间 开始时间
G

GWW

Unregistered / Unconfirmed
GUEST, unregistred user!
求助:delphi中如何对DBASE数据库实现PACK与REINDEX操作
 
use DbiPackTable and DbiRegenIndex :

DbiPackTable :
optimizes table space by rebuilding the table associated
with hCursor and releasing any free space.
DbiRegenIndex :
Regenerates an index to make sure that it is up-to-date (all
records currently in the table are included in the index and
are in the index order).

This example is included with Delphi in the BDE32.HLP file.
 
procedure PackTable(Table: TTable);
var
Props: CURProps;
hDb: hDBIDb;
Begin
if not Table.Active then raise EDatabaseError.Create;
{'Table必需已经打开'}
if not Table.Exclusive then raise EDatabaseError.Create;
{'Table必需以独占方式打开'}
Check(DbiGetCursorProps(Table.Handle, Props));
if (Props.szTableType = szDBASE) then
Check(DbiPackTable(Table.DBHandle,
Table.Handle, nil, szDBASE, True))
else raise EDatabaseError.Create;
{'Table必需是dBASE或FoxPro类型'}
Table.Open;
End;

 

按Boat示范编程,编译时提示:Undeclared idenlifier 'CURPROPS',

应如何解决,是否须在 uses 中加入某个单元?
 
uses BDE;

参见这个贴子:
http://www.gislab.ecnu.edu.cn/delphibbs/dispq.asp?LID=146194
 

问题已解决。非常感谢 liuly 与 Boat 的帮助。
 
多人接受答案了。
 
后退
顶部