DbConnectionString - property of object PmAdo

Database connection parameters.
DbConnectionString As String
s = oDb.DbConnectionString
Database connection parameters using the DbOpen method in the form of ADO ConnectionString. The ADO ConnectionString ( 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) - Defines which ADO Provider will be used for database connection. It can be the Microsoft company ADO Provider, 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 such 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;.
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 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

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 property configurator, that activates a window for easier connection configuration to most commonly used database.

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