Page 278 - DCAP408_WEB_PROGRAMMING
P. 278
Web Programming
Notes
Did u know? What are Filters?
Only Filters in the form of Criteria Strings (e.g. OrderDate > ’12/31/1999') affect the
contents of a persisted Recordset. Filters created with an Array of Bookmarks or using a
value from the FilterGroupEnum will not affect the contents of the persisted Recordset.
These rules apply to Recordsets created with either client-side or server-side cursors.
When you apply the adFilterPendingRecords flag to a filtered and modified Recordset in the
batch update mode, the resultant Recordset is empty if the filtering was based on the key field of
a single-keyed table and the modification was made on the key field values.
The resultant Recordset will be non-empty if one of the following is true:
The filtering was based on non-key fields in a single-keyed table.
The filtering was based on any fields in a multiple-keyed table.
Modifications were made on non-key fields in a single-keyed table.
Modifications were made on any fields in a multiple-keyed table.
The following table summarizes the effects of adFilterPendingRecords in different combinations
of filtering and modifications. The left column shows the possible modifications; modifications
can be made on any of the non-keyed fields, on the key field in a single-keyed table, or on any
of the key fields in a multiple-keyed table. The top row shows the filtering criterion; filtering
can be based on any of the non-keyed fields, the key field in a single-keyed table, or any of the
key fields in a multiple-keyed table. The intersecting cells show the results: + means that applying
adFilterPendingRecords results in a non-empty Recordset; - means an empty Recordset.
Non keys Single Key Multiple Keys
Non keys + + +
Single Key + - N/A
Multiple Keys + N/A +
Before using any functionality of a Recordset object, you must call the Supports method on the
object to verify that the functionality is supported or available. You must not use the functionality
when the Supports method returns false.
Example: you can use the MovePrevious method only if Recordset. Supports
(adMovePrevious) returns true.
Otherwise, you will get an error, because the Recordset object might have been closed and the
functionality rendered unavailable on the instance. If a feature you are interested in is not
supported, Supports will return false as well. In this case, you should avoid calling the
corresponding property or method on the Recrodset object.
Recordset objects can support two types of updating: immediate and batched. In immediate
updating, all changes to data are written immediately to the underlying data source once you
call the Update method. You can also pass arrays of values as parameters with the AddNew and
Update methods and simultaneously update several fields in a record.
If a provider supports batch updating, you can have the provider cache changes to more than one
record and then transmit them in a single call to the database with the UpdateBatch method. This
272 LOVELY PROFESSIONAL UNIVERSITY