Programming Guide : Working with a Database : How You Can Access a Database with DataStream Objects : How You Can Select a Mode for a DataStream Object
 
Share this page          
How You Can Select a Mode for a DataStream Object
The DataStream's Open method performs the actual data retrieval. One of its arguments, the mode of operation, determines the query's behavior. The various modes are:
QY_CACHE
Specifies that the retrieved data set is cached, allowing previous navigation and random seek; requires the Load and NextRow methods to display data.
QY_CURSOR
Specifies that the retrieved data set uses a DBMS cursor, allowing nested queries; requires the Load and NextRow methods to display data.
QY_DIRECT
Specifies that the retrieved data set is returned as in a select loop; precludes nested queries because a single select statement is in effect between the Open and Close of the DataStream object; requires the Load and NextRow methods to display data.
QY_ARRAY
Specifies that the retrieved data set is immediately loaded into the specified local array or table field by the Open method (making the Load and NextRow methods meaningless); requires the UpdField method to refresh the display if loading into a table field.
Using QY_ARRAY mode enhances performance if you are loading a table field because an entire array of data is loaded. However, to take advantage of the enhanced performance, the class of the array being loaded must have attribute names that match the names of the columns in the query (which can differ from the names of columns in underlying database tables due to “as” clauses).