CRecordset::snapshot doesn't work in VS2012 anymore - what's the alternative?

后端 未结 3 580
终归单人心
终归单人心 2021-01-14 09:04

Apparently, in VS2012, SQL_CUR_USE_ODBC is deprecated. [Update: it appears that the cursors library has been removed from VS2012 entirely].

MFC\'s CDatabase doesn\'

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 09:31

    If anyone else runs into this issue, here's what seems to be the answer:

    For ODBC to an Access database, connect using CDatabase mydb; mydb.OpenEx(.., 0), so that you ask the system not to load the cursor library.

    Then for the recordsets, use dynaset CMyRecordset myrs; myrs.Open(CRecordset::dynaset, ...).

    Finally, you must make sure that your tables have a primary key in order to use dynasets (keysets).

提交回复
热议问题