Windows API高手请进(100分)

Q

quiben

Unregistered / Unconfirmed
GUEST, unregistred user!
各位高手:<br>&nbsp; 在下目前碰到一难题,请帮解决:<br>aName: String;<br>&nbsp; i: Byte;<br>&nbsp; aExclusive, aActive: Boolean;<br>&nbsp; with Table1 do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; aActive := Active;<br>&nbsp; &nbsp; &nbsp; Close;<br>&nbsp; &nbsp; &nbsp; TableName := ATableName;<br>&nbsp; &nbsp; &nbsp; aExclusive := Exclusive;<br>&nbsp; &nbsp; &nbsp; Exclusive := True;<br>&nbsp; &nbsp; &nbsp; IndexDefs.Update;<br>&nbsp; &nbsp; &nbsp; I := IndexDefs.Count;<br>&nbsp; &nbsp; &nbsp; while I &gt; &nbsp;0 do<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; aName := IndexDefs.Items[I-1].Name;<br>&nbsp; &nbsp; &nbsp; &nbsp; DeleteIndex(aName);<br>&nbsp; &nbsp; &nbsp; &nbsp; Dec(i);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; AddIndex('','DBID',[ixPrimary, ixUnique]);<br>&nbsp; &nbsp; &nbsp; IndexDefs.Update;<br>&nbsp; &nbsp; &nbsp; Exclusive := aExclusive;<br>&nbsp; &nbsp; &nbsp; Active := aActive;<br>&nbsp; &nbsp; &nbsp; Check(DbiSaveChanges(Table1.Handle));<br>&nbsp; &nbsp; end;<br>当跟踪调试到Check(DbiSaveChanges(Table1.Handle))时,出现"Invalid Handle",不知是何<br>原固???
 
使用BDE的底层函数,最好不要和上层的控件混合着用:)<br>如果只是想立即保存你的索引修改结果的话,只需要把Table关掉然后重新打开即可
 
谢谢,但还有问题就是,主键是该过来了,但却不能向其作插入数据的操作了,为什么??
 
顶部