Data Access  «Prev 

Scripting with recordsets

Recordset object properties, methods, and Events

The recordset object has several properties, methods, and events that are exposed to scripting. The following tables provide a brief description of each.
PropertyPurposeSyntax
absolutePositionspecifies the absolute position of the current recordrecordset.absolutePosition[=index]
BOFindicates whether the cursor is positioned before the first recordrecordset.BOF
EOFindicates whether the cursor is at the end of the recordsetrecordset.EOF
fieldsspecifies an instance of the Fields objectrecordset.fields
idreturns a unique identifier for the objectrecordset.id
maintainStatespecifies whether object state is maintained during server processingrecordset.maintainState[=boolean]
namereturns the name of the objectrecordset.name

Method Purpose Syntax
addRecord creates a new record in the recordset recordset.addRecord()
advise registers an object to be notified when a specified event occurs and to call a particular function recordset.advise(event, function)
cancelUpdate cancels any changes being made to the current record recordset.cancelUpdate()
close closes the recordset object recordset.close()
deleteRecord deletes the current record recordset.delete()
getBookmark returns a bookmark for the current record recordset.getBookmark()
getConnectString returns a string or object that specifies the data connection recordset.getConnectString()
getCount returns the number of records in the recordset recordset.getCount()
getDHTMLDataSourceID returns a string from the DHTML data source's ID recordset.getDHTMLDataSourceID()
getParameter returns a parameter from a stored procedure or parameterized query recordset.getParameter(index)
getRecordSource returns the ADO recordset object recordset.getRecordSource()
getSQLText returns the SQL statement that queries the database recordset.getSQLTextg()
isOpen returns whether the recordset object is open recordset.isOpen()
move moves the cursor the specified number of positions recordset.move(records)
moveAbsolute moves the cursor to the specified record recordset.move(index)
moveFirst moves to the first record in the recordset recordset.moveFirst()
moveLast moves to the last record in the recordset recordset.moveLast()
moveNext moves to the next record in the recordset recordset.moveNext()
open opens a recordset object recordset.Open()
requery requerys the database recordset.requery()
setBookmark sets a bookmark to a particular record recordset.Bookmark(bookmark)
setParameter sets a parameter for a parameterized query or stored procedure recordset.setParameter.(index, parameter)
setRecordSource sets connection properties for opening a recordset object recordset.setRecordSource(ADO|conn,SQL)
setSQLText sets the SQL statement to query the database recordset.setSQLText(sql)
unadvise cancels the registration of an object recordset.unadvise(event, id)
updateRecord updates the current record recordset.updateRecord()

EventOccursSyntax
onafterupdateafter a record is updatedrecordset_onafterupdate
onbeforeopenjust before a recordset object is openedrecordset_onbeforeupdate
onbeforeupdatejust before a record is updatedrecordset_onbeforeupdate
ondatasetchangedwhen a change is made to the recordset objectrecordset_ondatasetchanged
ondatasetcompletewhen the server finishes downloading the recordsetrecordset_ondatasetsomplete
onrowenterwhen the cursor moves to another recordrecordset_onrowenter
onrowexitwhen the cursor moves to another recordrecordset.onrowexit