Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Open - method of object PmDatabase

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:
Open As Boolean
Calling:
b = oDb.Open()
Return Values:
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 (the initial values are taken over from the configurators on the Database page of this object).
If the "Open using the SQL statement SELECT" configurator is checked, the OpenSQL property is valid (it corresponds to the "SQL statement during opening" configurator) and the Table property is invalid on opening.
Vice versa if this configurator is not checked.
See also:
Example1:
"Open using the SQL statement SELECT" configurator is not checked
VBScriptSelect and copy to clipboard

If oDb.IsOpen() Then
  oDb.CloseTable
End If

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:
"Open using the SQL statement SELECT" configurator is checked
VBScriptSelect and copy to clipboard

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 ..."
PROMOTIC 9.0.0 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice