Promotic
WikipediaLinkedInYoutubeTwitterFacebook

DbOpen - method of the PmaAdo object

Description:
Connecting the PmaAdo object to the database. The connection is executed via the ADO Connection object, that is contained in the PmaAdo object. The parameters that are needed for connection are defined in the properties DbConnectionString and DbConnectionParams.
Syntax:
Object DbOpen([String sParams])
Calling:
b = oDb.DbOpen(sParams)
Parameters:
sParams[optional] (String) Additional parameters of the DbOpen method. Entries are in KeyVal format, for example "return:map;".
"return:xxx;" (optional) - Specifies whether the method return values is a map containing multiple values (new procedure) or a single value (old procedure). If not set, then the old procedure is used.
map - Returns a map (PmMap) containing multiple returned values (new procedure) (e.g. Result, AffectedRows, ErrorCode, ErrorText).
Return values:
New procedure: Returns PmMap object with values in following items:
- "Result": flag indicating successful database connection:
true - database connection successful
false - database connection failed
- "ErrorCode": numeric error code where the value 0 signals successful method execution (no error)
- "ErrorText": error text description
 
Old procedure: Returns flag indicating successful database connection:
true - database connection successful
false - database connection failed
Example:
Connecting the PmaAdo object ("/TestAdoDb") to the database ("pm_data"), for MS SQL Server (local instance named ".\SQLEXPRESS"), using the basic ADO Provider by the Microsoft company ("SQLOLEDB"), including the use of login name and password (MS SQL Server authentication).
JavaScriptVBScriptSelect and copy to clipboard

var oDb = pMe.Pm("/TestAdoDb");
oDb.DbConnectionString = "Provider=SQLOLEDB;Server=.\SQLEXPRESS;Database=pm_data;uid=pm_admin;pwd=pmadmin;";
oDb.DbConnectionParams = "";
if (!oDb.DbOpen())
//...

History:
Pm8.01.00: Created
Pm8.03.22: Returns the PmMap object with values in items "Result", "ErrorCode" and "ErrorText".
PROMOTIC 9.0.10 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