16.6. Working with Database

By default, Microsoft Access flat file database is included in a new project for ease of learning when it's created using Project Editor. A database is a basic requirement in a SCADA application. Typically being used to store data for Trending, Alarms, Tag Persistence or Report Archiving.

In production environment, a more reliable and larger database than Microsoft Access is required, IntegraXor can log to any ODBC-compliant database such as Microsoft SQL, Oracle, MySQL and PostgreSQL. Microsoft has released SQL Express for free with 10 GB data storage limitation, which is sufficient in most applications. It has toolset for database management which can be used to create, modify and view tables. Use this Management Tool to create customized tables for additional database logging requirement or to view logged data. It can be downloaded at http://www.microsoft.com/express/Database/.

To integrate with external databases, engineer need to add an entry into database task, with its relevant "Connection String". A comprehensive list of Connection Strings for various database can be found on this website: http://www.connectionstrings.com/. Commonly used connection string is listed in the following table.

Microsoft SQL Express

Provider=MSDASQL.1;
Extended Properties="DRIVER=SQL Native Client;
SERVER=<COMPUTER_NAME>SQLEXPRESS;
DATABASE=my_job;
trusted_connection=yes";

PostgreSQL

Driver={PostgreSQL};
Server=IPaddress;
Port=5432;
Database=myDataBase;
Uid=myUsername;
Pwd=myPassword;

MySQL

Driver={MySQL ODBC 5.1 Driver};
Server=localhost;
Database=myDataBase; 
User=myUsername;
Password=myPassword;
Option=3;
[Note] Note

Be aware the ODBC Driver version could be 3.51, or other numbers.


[Important] Important

Be aware the Connection Strings are shown in multiple line for better readability but must be entered as single line in actual use.


Clicking browse button [...] shall launch the Data Link Properties which could Test Connection on the string entered.

Firewall or trusted configuration is needed to configure for database that installed on different machine. The database port number must be enabled on firewall if any. This is needed for Redundancy setup whereby remote connection is in place. Below is a sample configuration needed for PostgreQL on Windows. Add the following line into C:\Program Files\PostgreSQL\9.2\data\pg_hba.conf, whereby 192.168.1.100 is IntegraXor hosted.

        
host    all             all             192.168.1.100/32            md5