Promotic

Open - method of the PmaDatabase object

Description:
It is used for the connection of the database and for opening its table (or the execution of the SQL statement SELECT) defined by the Database, Table or OpenSQL properties.
Syntax:
Boolean Open()
Return value:
true - If opening the database and its table passed successfully
false - Otherwise
Note:
The table is opened or the SQL statement SELECT is executed according to setting the Type, Database, Table or OpenSQL properties (initial values are taken over from the configurators of the "Database" tab of this object).
If the "Open table using the SQL statement SELECT" configurator is checked, then the OpenSQL property is valid (according to setting of the "SQL statement during opening" configurator) and the Table property is invalid on opening.
Vice versa if this configurator is not checked.
See also:
- PmaDatabase.OpenSQL (property)
Example1:
The "Open table using the SQL statement SELECT" configurator is not checked
JavaScriptVBScriptSelect and copy to clipboard

if (oDb.IsOpen())
{
oDb.CloseTable();
}

oDb.Table = "Table1";
oDb.Open();
// ... do something with the table Table1
oDb.CloseTable();

oDb.Table = "Table2";
oDb.Open();
// ... do something with the table Table2
Example2:
The "Open table using the SQL statement SELECT" configurator is checked
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 ..."
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.