OpenSQL - property of the PmaDatabase object
Description:
SQL statement of the
SELECT type on open
Note:
Property access
for read and write.
The default value of this property is defined in the "
SQL statement during opening" configurator of this object.
The SQL statement specifies which rows, columns from the table will be read by the object.
The property is used when calling the
Open method only if the "
Open table using the SQL statement SELECT" configurator configurator
is checked. Otherwise the
Table property is used and the whole content of the table is read.
Example:
JavaScriptVBScriptSelect and copy to clipboard
if (oDb.IsOpen())
{
oDb.CloseTable();
}
oDb.OpenSQL = "SELECT * FROM Table WHERE MyColumn BETWEEN 10 AND 100";
oDb.Open();
// ... do something with the query "SELECT * FROM Table ..."
oDb.CloseTable();
oDb.OpenSQL = "SELECT MyColumn1, MyColumn2 FROM Table WHERE MyColumn1 > 10";
oDb.Open();
// ... do something with the query "SELECT MyColumn1, MyColumn2 FROM Table ..."
If oDb.IsOpen() Then
oDb.CloseTable
End If
oDb.OpenSQL = "SELECT * FROM Table WHERE MyColumn BETWEEN 10 AND 100"
oDb.Open
' ... do something with the query "SELECT * FROM Table ..."
oDb.CloseTable
oDb.OpenSQL = "SELECT MyColumn1, MyColumn2 FROM Table WHERE MyColumn1 > 10"
oDb.Open
' ... do something with the query "SELECT MyColumn1, MyColumn2 FROM Table ..."