Database¶
Database object. Use it to read and write ADO data sources.
Action Summary¶
Action | Description |
---|---|
DoAttach | Attaches to a Database with given ADO connection string and SQL query. |
DoMoveToRow | Moves to a given row. |
DoRandom | Selects random row and column in the recordset. |
DoSequential | Advances to the next row in the table. |
GetColumnCount | Gets columns count. |
GetColumnName | Gets column name. |
GetColumnNames | Gets column names. |
GetCurrentRowIndex | Get zero based current row index. |
GetRowCount | Gets rows count. |
GetValue | Gets value by column name, and, optionally, row number. |
Action Detail¶
DoAttach¶
Attaches to a Database with given ADO connection string and SQL query.
Database.DoAttach(connection_string, sql)
Parameters:
Name | Type | Description |
---|---|---|
connection_string | string | ADO connection string. |
sql | SQL Query (i.e. 'select * from Customers') Optional. |
Returns:
true, if successful
DoMoveToRow¶
Moves to a given row.
Database.DoMoveToRow(rowInd)
Parameters:
Name | Type | Description |
---|---|---|
rowInd | number | Row index to set active. |
DoRandom¶
Selects random row and column in the recordset.
Database.DoRandom()
Returns:
'false' if the the DB is is not connected, 'true' - otherwise.
DoSequential¶
Advances to the next row in the table. When the end of the range is reached DoSequential returns 'false'.
Database.DoSequential()
Returns:
'false' if being called when active row is the last row or the recordset is not attached, 'true' - otherwise.
GetColumnCount¶
Gets columns count.
Database.GetColumnCount()
Returns:
Number of Columns in the result set.
GetColumnName¶
Gets column name.
Database.GetColumnName(ind)
Parameters:
Name | Type | Description |
---|---|---|
ind | number | Column index. |
Returns:
Name of column in the spreadsheet.
GetColumnNames¶
Gets column names.
Database.GetColumnNames()
Returns:
Array of column names in the table.
GetCurrentRowIndex¶
Get zero based current row index.
Database.GetCurrentRowIndex()
GetRowCount¶
Gets rows count.
Database.GetRowCount()
Returns:
Number of rows in the result set.
GetValue¶
Gets value by column name, and, optionally, row number. Returns current cell value after DoSequential or DoRandom if params not set.
Database.GetValue(columnId, rowId)
Parameters:
Name | Type | Description |
---|---|---|
columnId | Number | String | Column index or name. If not set 1st column is used. Optional. |
rowId | number | Row index. If not set current row is used. Optional. |