FindFirst - method of the PmaDatabase object
Description:
Search for the text string in the database table from beginning of the table.
Syntax:
Long FindFirst(String sFilter)
Parameters:
sFilter | (String) Text string in the SQL language syntax statement WHERE specifies the condition for searching |
---|
Note:
If the search is successful, the method returns an index of the found record and the pointer (of the current position) is set to this record, otherwise it returns the value
-1 and the current position remains unchanged.
This method
is not functional if the "
Technology" configurator is set to
Access through ODBC.
Example:
JavaScriptVBScriptSelect and copy to clipboard
// Search for the John Saruman value in the column of the String type named "Customer"
n = oDb.FindFirst("Customer = 'John Saruman'");
// Search for the numeric item
n = oDb.FindFirst("Price > 10000");
// Search for the time item. The time is set: - #month day year hour:minute:second#
n = oDb.FindFirst("Time > #10 24 2024 12:10:37#");
' Search for the John Saruman value in the column of the String type named "Customer"
n = oDb.FindFirst("Customer = 'John Saruman'")
' Search for the numeric item
n = oDb.FindFirst("Price > 10000")
' Search for the time item. The time is set: - #month day year hour:minute:second#
n = oDb.FindFirst("Time > #10 24 2024 12:10:37#")