Searching for Records
The method you should use to search for records is dependent upon the configuration of your recordset. PSQL supports the Index property and the Seek method for dynamic recordsets.
Although the functionality for the Sort and Find methods (which work only with static client-side cursors) is present in the OLE DB provider, they are not currently supported and it is recommended that you not use them. Index and Seek are more robust and utilize the PSQL engine directly for all searching and sorting, which results in a performance boost over using the client-side layer.
*Note: In order to use the Seek method, you must specify adCmdTableDirect when opening the Recordset.
The Seek method requires a variant array containing the values to search for. An index consists of one or more columns and the array contains a value to compare against each corresponding column. Thus, if you have a segmented index, you would need to declare the variant array with a number of elements equal to the number of segments in the current index.
rs.Open "Person", "Provider=PervasiveOLEDB;Data Source=Demodata", adOpenDynamic, adLockBatchOptimistic, adCmdTableDirect
Dim VariantArray (1) as Variant
VariantArray(0) = "CA"
VariantArray(1) = "Sacramento"
rs.Index = "State_City"
rs.Seek VariantArray adSeekFirstEQ
rs.Close