Returns a recordset object from a data source linked to an external datasheet based on a SQL query. Commonly used to work with datasheets set to use a script-generated query. The returned value is generally assigned to a variable for use with database statements, such as GetRowValue.
Syntax
OpenRecordsetQuery("DatasheetName", "SQLQuery")
Arguments
| Argument | Description |
|---|---|
| DatasheetName | External datasheet name. Must be in the current workspace and linked to a data source. |
| SQLQuery | SQL query to run. |
Return value
| Value | Description |
|---|---|
| Value | Recordset object opened from the linked external datasheet. |
Example
customerSet = OpenRecordsetQuery("Customers", "SELECT * FROM Email")
count = RecordsetRowCount(customerSet)
PrintLn(count)