RecordSet.getItemAt( )


RecordSet.getItemAt( ) Method Flash 6

returns the record at a given index number
   myRecordSet   .getItemAt(   index   ) 

Arguments

index

An integer between and the length of the RecordSet object minus one.

Returns

A row (i.e., a single record) of the RecordSet object.

Description

The getItemAt( ) method returns a full row of a recordset. The return value is a single record from the recordset, represented as an associative array whose keys correspond to the recordset's column names . You can retrieve individual fields by name from the row returned by this method.

Example

The following code returns a row of the recordset and then sets variables to the value of each field in the record:

 var myRow = myRecordset.getItemAt(0); var myFirstName = myRow.FirstName; var myLastName = myRow.LastName; myTextField.text = "Hello " + myFirstName + " " + myLastName; 

Individual fields can also be accessed through associative array notation, as in this example:

 var myRow = myRecordSet.getItemAt(0); var myFirstName = myRow["FirstName"]; 

See Also

RecordSet.addItemAt( ) , RecordSet.getColumnNames( ), RecordSet.replaceItemAt( ) ; Chapter 4



Flash Remoting
Flash Remoting: The Definitive Guide
ISBN: 059600401X
EAN: 2147483647
Year: 2003
Pages: 239
Authors: Tom Muck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net