auto increase 都是这样的, 删除后并不保证任何的连续, 它只能保证一个唯一 ID
想删除又要保证连续的可能性是没有的,可以的办法是建立另一个表用于保存空号的信息
想删除又要保证连续的可能性是没有的,可以的办法是建立另一个表用于保存空号的信息
解决方案 »
- 求达人来解~~~~~~~~
- 筛选数据
- 自动控件生成,请高手解决,在线等!
- -------------救命: 关于时间操作------------
- 不想再写代码兄和挂月兄,有没有办法在复制数据的同时用进度条显示进度?(内空)
- 100分求助,如何设计一个试卷分析系统,要求能求出某份卷子或题目的区分度,信度等数据,并以报表的形式打印出来
- DELPHI6.0中我用SQL在创建基本表的时候有如下错误:有解决之道者50分送赠。
- 如果实现combobox对于汉字输入的自选择功能?
- Delphi封装的线程对象,如何同步线程,其中有我用CreateOLEObject创建的ADO对象和系统的全局变量???如何同步???
- sos!sos!
- 明天9点就要期未考试了,但直到现在我还在玩我喜欢的DELPHI。大家给我提点意见,我明天2002年1月13日9点怎么过!!!。
- Access2000的压缩问题
PackTable(Table1);即可。Retorno是一个出错信息,你可以下管它。
uses
SysUtils, Classes, DB, DBTables, BDE, pubVar,
Messages, Dialogs;procedure PackTable(var tblName : TTable);
begin
Retorno := '';
with tblName do begin
fDbiPackTable(tblName, True, Retorno)
end;
end;
function fDbiPackTable(var TblName : TTable; bRegenIdxs: Boolean;
var Retorno : String): Boolean;
var
BdeResult : DbiResult;
Props: CURProps;
hDb: hDBIDb;
TableDesc: CRTblDesc;
bActive,bExclusive : Boolean;
begin
with TblName do begin
bActive := Active;
bExclusive := Exclusive;
if Active then Close;
if not Exclusive then Exclusive := True;
try
Open;
except
Retorno := 'Cannot open the table in exclusive manner';
Result := False;
Exit;
end;
end; // Get the table properties to determine table type...
Check(DbiGetCursorProps(TblName.Handle, Props)); if Props.szTableType = szDBase then begin
BdeResult := DbiPackTable(TblName.DBHandle, TblName.Handle, nil,szDBase, bRegenIdxs);
Case BdeResult of
DBIERR_NONE : Retorno := 'All table Indexes have been indexed';
DBIERR_INVALIDHNDL : Retorno := 'The Name of Table or the pointer to the same is Void';
DBIERR_NOSUCHTABLE : Retorno := 'The Table ' + TblName.TableName + ' not found';
DBIERR_UNKNOWNTBLTYPE : Retorno := 'The type of table is unknown';
DBIERR_NEEDEXCLACCESS : Retorno := 'The Table ' + TblName.TableName + 'it must be opened in exclusive manner';
else
Retorno := 'The BDE returns a not waited error';
end;
Result := (BdeResult = DBIERR_NONE);
end else begin
try
if Props.szTableType = szPARADOX then begin
FillChar(TableDesc, sizeof(TableDesc), 0);
Check(DbiGetObjFromObj(hDBIObj(TblName.Handle), objDATABASE, hDBIObj(hDb)));
StrPCopy(TableDesc.szTblName, TblName.TableName);
StrPCopy(TableDesc.szTblType, Props.szTableType);
TableDesc.bPack := True;
TblName.Close;
Check(DbiDoRestructure(hDb, 1, @TableDesc, nil, nil, nil, False));
Result := True;
end;
except
Retorno := 'An exception has taken place when packing the Paradox Table';
Result := False;
end;
end; with TblName do begin
Close;
Exclusive := bExclusive;
Active := bActive;
end;
end;
我的信箱[email protected]
谢谢