Promotic

DbConnectionString - property of the PmaAdo object

Description:
Database connection parameters.
Syntax:
String DbConnectionString
Values:
Database connection parameters by the DbOpen method in the form of ADO ConnectionString text string. The ADO ConnectionString (http://www.connectionstrings.com) contains all necessary parameters needed by the ADO Connection object for database connection via the selected ADO Provider. The typical parameters are represented for example by connection provider (provider), server address (server), database name (database), login name and password (uid, pwd), etc. The parameter list and exact syntax is defined by the corresponding ADO Provider, parameters may differ by individual ADO Providers. However for the sake of compatibility most providers ADO Provider understand multiple names of the main parameters simultaneously (e.g. the database name can be represented by database, data source, dbq, etc.). Caution: The syntax of this string is different than other strings used in the PROMOTIC system, the value and the name are separated by =, not by "colon" (:). Entries with assigned value are separated by a semicolon, for example "provider=SQLOLEDB;server=.\SQLEXPRESS;database=pm_data;uid=pm_admin;pwd=pmadmin;".

The defined parameters may not always be valid (for most common cases), it depends on the selected ADO Provider.

"provider:xxx;" (optional) - Specifies which ADO Provider will be used for database connection. It can be the ADO Provider by the Microsoft company, or another ADO Provider can be used, e.g. "provider=MSDASQL;"
MSDASQL (default) - Microsoft provider for ODBC.
SQLOLEDB - Microsoft provider for MS SQL Server.
Microsoft.Jet.OLEDB.4.0 - Microsoft provider for Access (*.MDB).
"server=xxx;" (optional) - SQL server name, that holds the database to connect to. Depends on the SQL server type. The name usually consists of the computer name (IP address) and server instance name, separated by separator character, for example "server=.\SQLEXPRESS;".
"database=xxx;" (optional) - Database name, e.g. "database=pm_data;".
"dsn=xxx;" (optional) - Name of registered ODBC DSN source. In this case, there is no need to enter the server, database or driver, because all thise information is defined in the registered DSN source, for example dsn=pm_data;.
"driver=xxx;" (optional) - Name of ODBC driver, e.g. driver={Microsoft dBASE Driver (*.dbf)};.
"uid=xxx;" (optional) - User name to be used for database connection, e.g. uid=pm_admin;.
"pwd=xxx;" (optional) - User password, e.g. pwd=pmadmin;.
Note:
Property access for read and write. The preset value of this property is defined in the "Database connection parameters" configurator of this object.
 
Database connection parameters in the form of a text string, use the same syntax as the ADO Connection object in the ConnectionString parameter. This string will be passed directly into the ADO without any additional modifications and checking, so it is possible to connect to any database (files, data), that have its own ADO provider or ODBC driver. This string is well described and many examples of use were published (even non-standard), for example http://www.connectionstrings.com.
The connection parameters will be used for the next database connection, for example by the DbOpen method.
In order to make the connection configuration easier there is a button in the "Database connection parameters" configurator, that activates a window for easier connection configuration to most commonly used database.
Example1:
JavaScriptVBScriptSelect and copy to clipboard

var sConnString = oDb.DbConnectionString;
Example2:
JavaScriptVBScriptSelect and copy to clipboard

oDb.DbConnectionString = "provider=SQLOLEDB;server=.\SQLEXPRESS;database=pm_data;uid=pm_admin;pwd=pmadmin;";
Example3:

History:
Pm8.01.00: Created
PROMOTIC 9.0.21 SCADA system documentation - MICROSYS, spol. s r.o.

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