ssCore.ADO.find

Find the first or next record matching some criteria in an open table.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

criteria - String that specifies the field, comparison operator and value to search for. The criteria follows the basic form of the SQL WHERE clause, but only one field is supported in the criteria and any attempt to use OR or AND will result in an error.

mode - [Optional] - A flag that specifies whether the operation should find the first row in the table that matches the criteria, or the next row (starting from the current position). Valid values include: FindFirst,FindNext. Default value is FindFirst.


Output Parameters:

result - A string which contains the current row data.

adoError - An ADO specific error message.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.ADO.find( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.ADO.find( paramsObject );


Notes:

An error code of "6" is not really an error, just an indicator that no records matched the criteria you provided, or in the case of a FINDNEXT operation, no more records match the criteria. In this case, the current row will be moved to the EOF (end of file) position causing future FINDNEXT operations to fail until the current row is repositioned by a findfirst operation or call to a function like ADO.moveFirst.

                

Examples:

The following example searches for a record in an open table and displays the result in the SWF Studio Trace tab.

var return_obj = ssCore.ADO.find({criteria:"FirstName = 'Lucille'"});

ssDebug.trace(return_obj.result);