A SERVICE OF

logo

3.11.2.1 Using the execute method
Executing Database Commands
Most major Database Management Systems (DBMSs) use the Structured Query Language (SQL) as their
query language. So executing a database command usually means sending an SQL statement to the
DBMS for execution. You can call the execute method of a connection object to execute a database
command. Before calling the execute method the connection object must represent an open connection to
a database. See connecting to ODBC databases and connecting to MySQL databases for more
information about connecting to databases.
See the Irie Pascal Programmer's Reference Manual (in "progref.html") for more information.
3.11.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:
The movenext method of a recordset object can be used to advance to the next record in the result
set returned by a query.
The eof property of a recordset object indicates whether or not the current record of the result set
is the last record.
The close method of a recordset object should be used when you have finished accessing a result