Visual InterDev

setSQLText Method

See Also      Applies To

Sets the SQL statement that is used to query the database for the recordset.

Syntax

object.setSQLText(strSQL)

Parameters

object

A script object.

strSQL

An SQL statement.

Remarks

In client script (Microsoft® Internet Explorer 4.0 DHTML), you can use the setSQLText method to reset the SQL statement while the recordset is actually open. After calling the setSQLText method, you must call the requery method to refresh the recordset.

In server script (ASP), the setSQLText method's behavior depends on the following:

Note   If you are using the setSQLText() method in server script (ASP), the SQLText will be maintained the next time you enter the page.

Example

Sub myRS_onbeforeopen()
dim sQuery
   sQuery = "select * from customers where lastname = 'Hoang'"
   myRS.setSQLText(sQuery)
End Sub