Openrecordset Options question

Posted on 2006-05-24
Last Modified: 2011-04-14
I had been using this statement:
Set rst = db.OpenRecordset(strSQL2, dbOpenDynaset, dbInconsistent)

I added an identity field to the linked sql table, now I get an error saying I need to add dbseechanges.

How to I use the dbInconsistent & the dbseechanges option?

Question by:NLGroup
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    you cannot use both at the same time. you have to use either dbInconsistent OR dbSeechanges, and as you are told by the message, you now have actually no choice.
    LVL 15

    Accepted Solution

    Set rst = db.OpenRecordset(strSQL2, dbOpenDynaset, dbInconsistent + dbseechanges)
    LVL 65

    Expert Comment

    From what I gather you have to use dbSeeChanges for any table that has a IDENTITY column.

    Some further info for you, just in case you wondering what the options are - Note, this is not an answer, as they answers have already been supplied. its just some info for you, ignore if you already know.

    2nd parameter

    dbOpenTable - Opens a table-type Recordset object (Microsoft Jet workspaces only).
    dbOpenDynamic - Opens a dynamic-type Recordset object, which is similar to an ODBC dynamic cursor. (ODBCDirect workspaces only)
    dbOpenDynaset - Opens a dynaset-type Recordset object, which is similar to an ODBC keyset cursor.
    dbOpenSnapshot - Opens a snapshot-type Recordset object, which is similar to an ODBC static cursor.
    dbOpenForwardOnly - Opens a forward-only-type Recordset object.

    3rd Parameter

    dbAppendOnly - Allows users to append new records to the Recordset, but prevents them from editing or deleting existing records (Microsoft Jet dynaset-type Recordset only).
    dbSQLPassThrough - Passes an SQL statement to a Microsoft Jet-connected ODBC data source for processing (Microsoft Jet snapshot-type Recordset only).
    dbSeeChanges - Generates a run-time error if one user is changing data that another user is editing (Microsoft Jet dynaset-type Recordset only). This is useful in applications where multiple users have simultaneous read/write access to the same data.
    dbDenyWrite - Prevents other users from modifying or adding records (Microsoft Jet Recordset objects only).
    dbDenyRead - Prevents other users from reading data in a table (Microsoft Jet table-type Recordset only).
    dbForwardOnly - Creates a forward-only Recordset (Microsoft Jet snapshot-type Recordset only). It is provided only for backward compatibility, and you should use the dbOpenForwardOnly constant in the type argument instead of using this option.
    dbReadOnly - Prevents users from making changes to the Recordset (Microsoft Jet only). The dbReadOnly constant in the lockedits argument replaces this option, which is provided only for backward compatibility.
    dbRunAsync - Runs an asynchronous query (ODBCDirect workspaces only).
    dbExecDirect - Runs a query by skipping SQLPrepare and directly calling SQLExecDirect (ODBCDirect workspaces only). Use this option only when you’re not opening a Recordset based on a parameter query. For more information, see the "Microsoft ODBC 3.0 Programmer’s Reference."
    dbInconsistent - Allows inconsistent updates (Microsoft Jet dynaset-type and snapshot-type Recordset objects only).
    dbConsistent - Allows only consistent updates (Microsoft Jet dynaset-type and snapshot-type Recordset objects only).

    The constants dbConsistent and dbInconsistent are mutually exclusive, and using both causes an error.

    Author Comment

    Thanks everyone!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now