UltraLite ActiveX User's Guide
Understanding UltraLite ActiveX Development
Accessing and manipulating data using the table API
UltraLite has several modes of operation when working with data. Two of these modes, the find and lookup modes, are used for searching. The ULTable object has methods corresponding to these modes for locating particular rows in a table.
NoteThe columns searched using Find and Lookup methods must be in the index used to open the table. |
Find methods move to the first row that exactly matches a specified search value, under the sort order specified when the ULTable object was opened.
For more information about find methods, see FindBegin method.
Lookup methods move to the first row that matches or is greater than a specified search value, under the sort order specified when the ULTable object was opened.
For more information about lookup methods, see LookupBackward method.
To search for a row
Enter find or lookup mode.
Call the FindBegin or LookupBegin method. For example, the following code fragment calls ULTable.FindBegin.
' eMbedded Visual Basic tCustomer.FindBegin
// JScript tCustomer.FindBegin();
Set the search values.
You do this by setting values in the current row. Setting these values affects the buffer, not the database. For example, the following code fragment sets the last name column in the buffer to Kaminski.
' eMbedded Visual Basic ColLastName.Value = "Kaminski"
// JScript ColLastName.Value = "Kaminski";
For multi-column indexes, a value for the first column is required, but you can omit the other columns.
Search for the row.
Use the appropriate method to carry out the search. For example, the following instruction looks for the first row that exactly matches the specified value in the current index.
' eMbedded Visual Basic tCustomer.FindFirst
// JScript tCustomer.FindFirst();