Livecode Wiki
Advertisement

Returns the number of records in a record set (database cursor)(glossary).Syntax:

revNumberOfRecords(<recordSetID>)

Examples:

revNumberOfRecords(westCoastCustomers)
get revNumberOfRecords(15) -- number of records in record set 15
repeat for revNumberOfRecords(pastDueCustomers) times

Use the revNumberOfRecords function to find out how many records matched a query.

If the query is not successful, the revNumberOfRecords function returns an error message that begins with the string "revdberr".

Some database types do not support returning the number of records in a result set. One example of this is ODBC data sources with forward-only cursors. If the database does not support this feature, the revNumberOfRecords function will return -1.

The revGetDatabaseDriverPath function is part of the 

Database library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Database" library checkbox is checked.

Parameters:

  • recordSetID: The number returned by the revQueryDatabase function when the recordset was created.
  • Returns: The revNumberOfRecords function returns either a non-negative integeror -1 if the number of records could not be determined.

See also: Database library (library),

Advertisement