Results 1 to 3 of 3
  1. #1
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208

    Recordset - Type vs Option

    Does anyone know of a good reference for EXPLAINING the various Type and Option parameters to the OpenRecordset call? I have found truckloads of documentation that states uber-helpful things like "dbReadOnly opens the recordset as read-only". Wow - who would have guessed?

    I'm trying to figure out the impact of, for instance:

    1. what is the difference between Type:=dbOpenForwardOnly and Option:=dbForwardOnly;
    2. what is the difference between Type:=dbOpenDynamic and Type:=dbOpenDynaset;


    3. what is the consequence of using Type:=dbOpenDynaset and Option:=dbReadOnly at the same time.

    Most documentation and explanations only repeat what MS puts in BOL and similar sites, a few explain some minor helpful things like dbOpenTable cannot be used with linked tables, but I have not found anything that really goes into detail about what can and cannot be done, in what combinations.

    There are 5 types and 12 options - and since they are not all mutually exclusive, that means theoretically (2 ^ 5) * (2 ^ 12) possible combinations to try, then exhaustively test all possible properties and methods in the combinations that don't crash on opening, in both ADO and DAO. That's a bit more work than I'm willing to tackle.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    you only need 2:

    dbOpenDynaset is default so no need to type any extra.
    Set rst = CurrentDb.OpenRecordset(sSql)

    if you want READONLY recset, use snapshot.

    Set rst = CurrentDb.OpenRecordset(sSql, dbOpenSnapshot)


    never needed anything else.

  3. #3
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by ranman256 View Post
    you only need 2:

    dbOpenDynaset is default so no need to type any extra.
    Set rst = CurrentDb.OpenRecordset(sSql)

    if you want READONLY recset, use snapshot.

    Set rst = CurrentDb.OpenRecordset(sSql, dbOpenSnapshot)


    never needed anything else.
    Yes, this is what I have been doing for the most part, but these other options are not there just for show. I'm trying to learn what they do, how they work, and when is the best situation to use each kind, not just what is the minimum I can get away with. For instance, a forward-only recordset is supposed to be faster than a read-only. But why? And where do I specify that? As Type? As Option? Both? Either? Does it matter? Snapshot is also supposed to be faster, but I think I remember not quite as fast as a forward-only. But what if I specify type as both forward-only and snapshot? Or Type as snapshot and Option as forward-only? Does the faster one take precedence? Or the most functional one? Do they combine somehow?

    OpenTable also enables some extra functionality on local tables that Dynaset does not, which might be useful. I appreciate the feedback, but I'm not simply trying to get something working here - rather, I'm trying to expand my overall knowledge of this functionality.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Recordset Type Mismatch
    By MrBologna in forum Programming
    Replies: 14
    Last Post: 06-11-2020, 09:20 AM
  2. Replies: 6
    Last Post: 09-24-2019, 06:39 PM
  3. Replies: 1
    Last Post: 12-05-2014, 07:41 PM
  4. Editing with RecordSet Type = Dynaset
    By Access_Novice in forum Forms
    Replies: 4
    Last Post: 01-21-2014, 01:45 PM
  5. Replies: 10
    Last Post: 12-24-2011, 03:37 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums