Configuring the ODBC Connector

<< Click to Display Table of Contents >>

Navigation:  Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > Function library > The ODBC Library >

Configuring the ODBC Connector

For proper operation of Lua functions from the section ODBC, an ODBC connector must be initially installed and configured. The connector is configured using standard administrative tools Control panel - System and security - Administration tools - ODBC data source administrator (32-bit).

Note. Regardless of an OS type and a DBMS type, a 32-bit version of an ODBC connector must be used, and you should use a 32-bit version of the utility to configure the connector.

Note about MS SQL. In case of MS SQL for 64-bit OS, you should install an x64 version of the ODBC connector; that version includes a 32-bit driver version as well. An x86 version of the MS SQL ODBC driver cannot be installed on an x64 computer. If both MS SQL and Management Studio are locally installed on a computer, it is not required to install an ODBC connector.

Below is an example of how to configure the MS SQL ODBC connector.

If MS SQL is installed on a computer, the ODBC connector is most likely installed as well. Otherwise, you should download it from the manufacturer site (Microsoft® ODBC Driver 11 for SQL Server).

Execute the command ODBC data source administrator (32-bit) from the Windows control panel. The following dialog is displayed:  

nastrojka_odbc_konnektora

Click the button Add to display the whole list of available ODBC drivers. Find ODBC driver for SQL Server.

nastrojka_odbc_konnektora1

Click Finish. The connection configuration master is displayed. Type a connection name (used in the function odbc.env_create) and a description, and select a server the ODBC connector will be connected to.

nastrojka_odbc_konnektora2

Click Next. Specify authentication parameters: according a Windows account or according SQL authentication.

nastrojka_odbc_konnektora3

Click Next. Specify a default database, and other parameters if required.

nastrojka_odbc_konnektora4

Click Next. Extra parameters can be specified at the last step of the master.  Click Finish.

nastrojka_odbc_konnektora5

The connection is added to the list of sources.

nastrojka_odbc_konnektora6

Now the configuration is completed, and you can start to create a script.

See also

Functions to Operate via ODBC