Creating a Standard Recordset

In DAO you would create a recordset, like this

Set rs = db.OpenRecordset( source, options) But in ADO, you could do it like this:

rs.Open Source, ConnectionString, CursorType, LockType, Options

The Source argument can be an SQL statement, the name of a table, the name of a stored procedure, a URL, or a provider-specific text or command. The ConnectionString argument can be a Connection object or a Connection string. Appendix J contains a list of all the available CursorType, LockType, and Options values.

You can supply more than one Options value by using the AND operator, for example: rs.Options = adCmdStoredProc And adAsyncFetchNonBlocking

0 0

Post a comment