SQL错误16943的程序化修复? [英] Programmatic Fix for SQL Error 16943?

查看:101
本文介绍了SQL错误16943的程序化修复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的VC ++程序之一使用MS SQL Server 2000作为数据库,并且该应用程序是用VC ++ 6.0编码的. DB部分由MFC的CRecordset等控制.数据通过以下顺序填充

One of my program in VC++ uses the MS SQL Server 2000 as the DB and the app was coded in VC++ 6.0. The DB part was governed by the MFCs CRecordset and so on. The data is populated through the sequence as follows

1.CRecordset::AddNew();<br />
2.Fill all the columnar data of the record<br />
3.CRecordset::Update()



现在出现的问题是,如果应用程序运行了优化作业,则第三步将引发以下SQL错误(通过SQL事件探查器)



The problem now surfaces is, when the app running if the Optimization Job is done then the 3rd step throws the following SQL Error(By SQL Profiler)

Msg 16943, Level 16, State 4 Could not complete cursor operation because the table schema changed after the cursor was declared.



此外,我在数据库端未使用任何游标/存储过程.
请帮助我解决此问题.提前致谢. :)



Moreover I am not using any of the cursors/Stored Procedures in my DB side.
Please help me out in fixing this. Thanks in advance. :)

推荐答案

FIX:当您尝试从中检索行时出现错误消息SQL Server 2005中使用OPTION(RECOMPILE)查询提示的游标:无法完成游标操作,因为在声明游标之后表结构已更改" [

这篇关于SQL错误16943的程序化修复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆