parameters to OpenRecordset method?

G

Guest

In looking at the documentation for the OpenRecordset() method, I see two versions. The signature for Connection's & Database's is:

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

while for QueryDef's, Recordset's, & TableDef's, the signature is:

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

In one of the online examples (and one that I got to work...), the code is:

Set rstTemp = dbsNorthwind.OpenRecordset("Ten Most Expensive Products", dbOpenForwardOnly)

This only specifies a type value as a parameter. The documentation doesn't elude that options & lockedits are optional. Are these values collectively being used to set a mask? Otherwise, how am I to know which parameters are optional or not? Thanks for any insight provided.

Jim
 
V

Van T. Dinh

Type, Options and LockEdits are optional as per Help topic on OpenRecordset.
The arguments set how the Recordset will be created and used. For example,
with the type "dbOpenForwardOnly", you can only traverse the Recordset from
the 1 Row to the last Row but can not go "previous".

In the first syntax, the "object" must be a Connection Object or a Database
Object.

In the second syntax, the "object" must be a TableDef or QueryDef or
Recordset Object.

Read the Help topic carefully as there are lots of info.

--
HTH
Van T. Dinh
MVP (Access)



Jim said:
In looking at the documentation for the OpenRecordset() method, I see two
versions. The signature for Connection's & Database's is:
Set recordset = object.OpenRecordset(source, type, options, lockedits)

while for QueryDef's, Recordset's, & TableDef's, the signature is:

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

In one of the online examples (and one that I got to work...), the code is:

Set rstTemp = dbsNorthwind.OpenRecordset("Ten Most Expensive Products", dbOpenForwardOnly)

This only specifies a type value as a parameter. The documentation
doesn't elude that options & lockedits are optional. Are these values
collectively being used to set a mask? Otherwise, how am I to know which
parameters are optional or not? Thanks for any insight provided.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top