Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2016-08-25 16:57:14

ad_t
Member
Registered: 2016-05-09
Posts: 52

MSSQL connection

Hi,

At some point soon I am going to have to connect to a existing MSSQL database at the same time as my MySQL one.

Is it possible to connect to two or more different types of database from the same task?
If so is there anything I should know about when setting it up, or any pointers where to look for more info about this?
Also are you able to point me to any information on connecting to a MSSQL database, as all the documentation refers to MySQL?

Cheers,

Adam

Offline

#2 2016-08-26 09:44:36

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: MSSQL connection

Hi Adam,
thanks for your questions! MsSQL connection is possible, the configuration is very similar to MySQL. You need to install unixodbc and tdsodbc packages on your Raspberry Pi:

sudo apt-get install unixodbc tdsodbc

Moreover you need to add the following to /etc/odbcinst.ini:

[MSSQL]
Description     = Microsoft SQL driver
Driver          = /usr/lib/arm-linux-gnueabihf/odbc/libtdsodbc.so

The rest is the same as in the case of MySQL database.

Connecting to 2 (or more) databases is also possible, you just need to put 2 (or more) IODRV blocks in your executive configuration.

See this topic which deals with the same question, only for S7 driver for Siemens PLCs.

If you need additional explanation, I'll be happy to help.

Jaroslav

Offline

#3 2016-08-26 12:42:00

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: MSSQL connection

Thank you Jaroslav, I have it working now. As always your help is appreciated and invaluable.

Cheers,

Adam

Offline

#4 2016-08-26 14:11:33

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: MSSQL connection

Glad I could help!

Offline

Board footer

Powered by FluxBB