MSDN:
Invalid cursor state
Appears when Microsoft® SQL Server™ runs out of resources while attempting to save selected tables or a database diagram.ODBC error text
[Microsoft][ODBC SQL Server Driver]Invalid cursor state.Cause
There is insufficient space in your database or transaction log to complete the save process.Recommended solution
Check to see if the database or the transaction log is full. If so, increase the size of the database to accommodate the change. Check other system resources or contact your System Administrator.For more information about increasing the size of your database, see "Expanding or Shrinking Databases" in SQL Server Books Online.

解决方案 »

  1.   

    可能是ado对象的CursorType属性不适合。
    下面是4个可选值
    AdOpenForwardOnly 仅向前游标,默认值。除了只能在记录中向前滚动外,与静态游标相同。当只需要在记录集中单向移动时,使用它可提高性能。 
    AdOpenKeyset 键集游标。尽管从您的记录集不能访问其他用户删除的记录,但除无法查看其他用户添加的记录外,键集游标与动态游标相似。仍然可以看见其他用户更改的数据。 
    AdOpenDynamic 动态游标。可以看见其他用户所作的添加、更改和删除。允许在记录集中进行所有类型的移动,但不包括提供者不支持的书签操作。 
    AdOpenStatic 静态游标。可以用来查找数据或生成报告的记录集合的静态副本。另外,对其他用户所作的添加、更改或删除不可见。 
      

  2.   

    打开数据库的时候使用 CDatabase::useCursorLib    db.OpenEx(..., CDatabase::useCursorLib|CDatabase::noOdbcDialog );