难道真的没人遇到这种问题吗?????

xjspa 2002-10-14 02:01:38
最近delphi6.0+SQLSERVER 2000 做一个系统时,遇到了一个我以前在DEPHI5.0用同样的方法不出错的问题具体如下:
我想给纪录进行编号:例如
1 JKX
2 JDX
3 JGX
4 YYX
当我将某一纪录删除后:例如 删除 JDX 后整体记录如下:
1 JKX
2 JGX
3 YYX
我在DELPHI 6.0 中的代码如下:
with table1 do
begin
open;
first;
i:=1;
while not eof do
begin
edit;
fieldbyname('serial_num').asinteger:=i;
inc(i);
next;
end;
if (dsedit= state) or (dsinsert= state) then
post;
end;
但老是提示出错:OBDB 出错信息如下:
---------------------------
Debugger Exception Notification
---------------------------
Project p_table_try.exe raised exception class EDBEngineError with message 'Capability not supported.
General SQL error.
[Microsoft][ODBC SQL Server Driver]没有执行可选特性'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
...全文
21 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xjspa 2002-10-14
  • 打赏
  • 举报
回复
上面的方法还是不行
dicke 2002-10-14
  • 打赏
  • 举报
回复
第一位仁兄的方法很好用的呀
dicke 2002-10-14
  • 打赏
  • 举报
回复
UO
qybao 2002-10-14
  • 打赏
  • 举报
回复
把这段代码去掉试试
if (dsedit= state) or (dsinsert= state) then
post;
s_x_d 2002-10-14
  • 打赏
  • 举报
回复
for i:=1 to table1.RecordCount do
begin
table1.Edit;
table1.FieldByName(''serial_num').Value:=i ;
table1.Post;
table1.Next;
end;

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧