Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Open - method of object PmDatabase

Description:
It serves 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 as per 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" 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 isn't checked
If oDb.IsOpen Then
  oDb.CloseTable
End If
oDb.Table = "Table1"
oDb.Open
'... do something with the table Table1
oDb.Table = "Table2"
oDb.Open
'... do something with the table Table2
Example2:
"Open using the SQL statement SELECT" configurator is checked
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.OpenSQL ="SELECT MyColumn1, MyColumn2 FROM Table WHERE MyColumn1 > 10"
oDb.Open
'... do something with the query "SELECT MyColumn1, MyColumn2 FROM Table ..."
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice