<< Click to Display Table of Contents >> Manual > Device Connection Guide > Database > Connection Procedure > ODBC |
overview
The ODBC unit allows you to connect to a database via the Windows ODBC driver and retrieve data stored in tables via tags.
One tag is linked to one field. If the number of records is 1, it will be linked to the first record. If the number of records is 2 or more, it will become an array tag and will be linked in order from the first record.
Below is an example table.
FIELD01 |
FIELD02 |
FIELD03 |
123 |
… |
… |
456 |
… |
… |
789 |
… |
… |
… |
… |
… |
For example, if you set it as follows, the tag value will be "123".
Also, if you set it as shown below, it will become an array tag and the value will be "123,456,789".
When retrieving data from a database, a SELECT statement is issued internally. Therefore, depending on the type of database, the data retrieved may be in random order.
If you want to always retrieve data from the first record in a table, you need to create a view table in the database that sorts the records with an ORDER statement, and then connect to that view table. However, when using a view table, be aware that writing from the Server application may not be possible. Also, some databases may not allow you to reference view tables, so please check in advance whether view tables can be referenced. |
Database field names cannot start with a number. Example) NG: 1Field OK: Field1 |
Settings Dialog Details
Unit communication settings
|
•Data Source Name
•Table Settings
•Schema name |
ODBC Settings
|
•Data Source Name
•Login Settings
|
Tag communication settings
|
•Field Name
•Number of records
|