Contents | Prev | Next

2.5.3.1 Using the recordset object

Most major Database Management Systems (DBMSs) use the Structured Query Language (SQL) as their query language. Some SQL statements return result sets. The recordset object is used to send SQL statements to DBMSs and access the result set(s) returned. The open method of a recordset object is used to send the SQL statement to the DBMS and prepare to access the result set returned. After opening the recordset object you can access the result set, one record at a time.

The field property of a recordset object is used to retrieve the value of a field of the current record in the result set. For example if you have a recordset object rs with an open recordset and the records in the recordset have a field named last_name then

   rs.field('last_name')

contains the contents of the field last_name for the current record in the recordset.

field is a read-only property of type variant.

NOTE: The field property is read-only so you can not use it to change the contents of the record fields (i.e. you can't use this property to effect the data in the database). If you want to affect the data in the database you should call the execute method of an connection object and pass it a SQL UPDATE statement.

NOTE: Since the field property is used so often Irie Pascal allows you to leave out the name of the property. So for example

   rs.('last_name')

is equivalent to

   rs.field('last_name')

Other useful methods and properties of recordet objects are:

See the Irie Pascal Programmer's Reference Manual (in "progref.html") for more information.

Contents | Prev | Next