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 Recordset script object.

strSQL

An SQL statement.

Remarks

In client script (Microsoft® Internet Explorer 4.0 DHTML), using the setSQLText method will actually change the SQL property of the RDS control, thus causing a requery of the data source which resets 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