Promotic

Database connection parameters (connection string)

The connection string contains parameters with assigned values that are separated by semicolon. The most important is the name of the connection Provider, that is usually listed first. The other parameters are required by the corresponding provider for successfull connection.
 
Another option is connection via "Denominated ODBC sources". It means that in Windows OS configuration window "ODBC data source manager" the corresponding Provider is selected and configured for database access. This database connection profile has a unique name. The connection string then uses the connection profile name, for example:
dsn=UserNameSource;uid=NameUser;pwd=PasswordUser;Initial Catalog=NameDb;
Database connection parameters (connection string):
Database type
ODBC - Named ODBC source (default) - dsn=ODBCSourceName;pwd=password;
dBase - Provider Microsoft - $.join("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=","$.path("data",""),";")
dBase - Provider Jet.4 - $.join("Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=dBASE IV;Data Source=","$.path("data","")),";")
Access - Provider Microsoft - $.join("Driver={Microsoft Access Driver (*.mdb)};Dbq=",$.path("data","dbfile.mdb"),";")
Access - Provider Jet.4 - $.join("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=false;Data Source=",$.path("data","dbfile.mdb"),";")
MsExcel 2003 - Provider Jet.4 - $.join("Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='Excel 8.0;HDR=Yes;IMEX=0';Data Source=",$.path("data","file.xls"),";")
MsExcel 2007,2010 - Provider Microsoft - $.join("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};ReadOnly=0;Dbq=",$.path("data","file.xlsx"),";")
DB - Firebird - PROVIDER=MSDASQL;DRIVER={Firebird/InterBase(r) driver};SERVER=localhost;DATABASE=pm_data;UID=pm_writer;PWD=pmwriter;
MsSql - SQL Server (Windows authentication) - provider=SQLOLEDB;Server=.\SQLEXPRESS;Database=db_name;Integrated Security=SSPI;
MsSql - SQL Server (SQL user) - provider=SQLOLEDB;Server=.\SQLEXPRESS;Database=db_name;Uid=owner;Pwd=password;
MsSql - SQL Server Compact - Provider=Microsoft.SQLSERVER.CE.OLEDB.4.0;ssce:max database size=4091;Persist Security Info=False;Data Source=",$.path("data","pm_data.sdf"),";")
MySql - MySQL ODBC 8.0 Driver - Driver={MySQL ODBC 8.0 Unicode Driver};Server=localhost;Database=dbname;User=username;Password=password;Option=3;
Oracle - Oracle in OraClient11g - Driver={Oracle in OraClient11g_home1};Dbq=myTNSServiceName;Uid=myUsername;Pwd=myPassword;
PostgreSQL - psqlODBC Driver - Provider=MSDASQL;Driver={PostgreSQL UNICODE};Server=localhost;Port=5432;Database=dbname;Uid=username;Pwd=password;
See also:

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

Send page remarkContact responsible person
Navigation:
 
- ADO
 
- Database connection parameters (connection string)
 
 
© MICROSYS, spol. s r.o.