Promotic

Description of handling PmaDatabase object if table does not exist

If a database table does not exist, then it can be created by methods PmaDatabase.Create, ...
Caution! - these methods are not functional over the table accessed by ODBC.
If working with non-existing table (or non-existing database) the PmaDatabase object must be closed e.g. by the PmaDatabase.Close method (methods PmaDatabase.Open,... cannot be used and also the "On start" configurator must be set to value Don't connect the database and don't open the table or it is necessary to close the table and the database by the PmaDatabase.Close method before calling the PmaDatabase.Create method).
Example:
Let's have established (in the PmaRoot object) an object of the PmaDatabase type named "Database". Example of creating a table in the database:
JavaScriptVBScriptSelect and copy to clipboard

var oDb = pMe.Pm("/Database");
oDb.Create();
oDb.CreateField("columnText", 10, 180);   // 10 - string
oDb.CreateField("columnBool", 1, 0);   // 1 = Boolean
oDb.CreateField("columnReal", 6, 0);   // 6 = Single
oDb.CreateField("columnTime", 8, 0);   // 8 = Date
oDb.CreateEnd();
Thus created table can be treated in a standard way.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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