Category: DataBase

The fastest way to search for a particular record is to use the Seek method , which can be used only with a table recordset tab.The Seek method uses indexes for the search , which is much faster than checking every record in the table as you do in a find .

 

In order to do a seek , the field on which you search must be defined with an index.

Syntax:

Data1.Recordset.Seek ComparisonOperator , FieldValue

The comparison operator must be enclosed in quotation marks and can be any one of this "=",">=",">","<=","<".The field value is the actual value for which to search string literal must be enclosed in quotation marks;numeric values must not be so enclosed.

Example:

i. Data1.Recordset.Seek "=", "0-671-66398-4"

ii.Data1.Recordset.Seek ">=", 1 'find first record greater than or equal to 1 in the first position of the key

 

 



Dinesh ThakurDinesh Thakur is a Columinist and designer with strong passion and founder of Computer Notes. if you have any ideas or any request please get @me on Google+
linkedin FaceBook Twitter Google Plus