OpenRecordset VBA Parameters

All replies

  • I take it you are referring to the DAO's (Data Access Objects) OpenRecordSet Method. See below for the parameters.

    You can also view the DAO help file complete with method call syntax and examples in either 1 of your local folders (depending on what version of DAO / Office you have installed.).

    Location 1: C:\Program Files\Common Files\Microsoft Shared\Office10\1033\DAO360.CHM

    Location 2: C:\Program Files\Common Files\Microsoft Shared\DAO\DAO35.HLP


    OpenRecordset Method


    Creates a new Recordset object and appends it to the Recordsets collection.


    For Connection and Database objects:

    Set recordset = object.OpenRecordset (source, type, options, lockedits)

    For QueryDef, Recordset, and TableDef objects:

    Set recordset = object.OpenRecordset (type, options, lockedits)

    The OpenRecordset method syntax has these parts.

    Part Description
    recordset An object variable that represents the Recordset object you want to open.
    object An object variable that represents an existing object from which you want to create the new Recordset.
    source A String specifying the source of the records for the new Recordset. The source can be a table name, a query name, or an SQL statement that returns records. For table-type Recordset objects in Microsoft Jet databases, the source can only be a table name.
    type Optional. A constant that indicates the type of Recordset to open, as specified in Settings.
    options Optional. A combination of constants that specify characteristics of the new Recordset, as listed in Settings.
    lockedits Optional. A constant that determines the locking for the Recordset, as specified in Settings.


    • Proposed as answer by Sara_111 Wednesday, October 06, 2010 6:52 PM
    Tuesday, August 22, 2006 12:30 AM
  • Using which object model? Jet engine's DAO? Jet's OLE DB (ADO) provider?
    Something else?

    -- Cindy (Word MVP)

    Tuesday, August 22, 2006 3:43 PM