ADO Requery Method

Home | About me | EXCEL VB Programming (XL97-2003) | ACCESS Programming | EXCEL VB.Net Programming | EXCEL Spreadsheet Functions Material Management  |  Guestbook
 

ADO Requery Method

The Requery method updates (refresh) the data in a Recordset object.This is essentially equivalent to a Close followed by an Open.

The Requery method is called to update all of the records in an open Recordset by re-executing the query to the database that originally created the Recordset.

If you need to change any of the property settings, you will have to call Close on the Recordset and then make the desired changes. This is because the properties are read-only when the Recordset is open and are read/write when the Recordset is closed.

If you are in the process of adding a new record or editing the current record, an error will be generated if you call this method.

If your database can be accessed by other users, it is quite possible that the new Recordset generated by the Requery will differ, perhaps significantly, from the previous Recordset.

Syntax

objRecordset.Requery options

There is one optional parameter.
 
Parameter

Description

options Optional. Specifies how to execute this command. Can be an ExecuteOptionEnum value

 

ExecuteOptionEnum Values

Constant Value

Description

adOptionUnspecified -1 Unspecified command
adAsyncExecute 16 The command should execute asynchronously. Cannot be combined with the CommandTypeEnum value adCmdTableDirect
adAsyncFetch 32 The remaining rows after the initial quantity specified in the CacheSize property should be retrieved asynchronously
adAsyncFetchNonBlocking 64 The main thread never blocks while retrieving. If the requested row has not been retrieved, the current row automatically moves to the end of the file. If you open a Recordset from a Stream containing a persistently stored Recordset, adAsyncFetchNonBlocking will not have an effect; the operation will be synchronous and blocking. adAsynchFetchNonBlocking has no effect when the adCmdTableDirect option is used to open the Recordset
adExecuteRecord 512 The CommandText is a command or stored procedure that returns a single row which should be returned as a Record object