Hello,
I want to ask you for little help. I'm struggling with ODBC connection under linux.
I have cache database on ubuntu server 14.04. I want to read MsSQL database situated on another (windows) server from my cache server.
So what I have done by far. First of all I installed 'Microsoft ODBC Driver 11 for SQL Server'.
I modified .odbc.ini file in administration's root directory.
I used 'isql' command to see if everything is alright. The result is successful connection to MsSQL.
But It's difficult for me to read that database from my cache server 2012.
As secound step I add the description of my odbc in cacheodbc.ini file situated in 'mgr' folder.
I did the following:
In [ODBC Data Sources] section I add:
MSSQL = MSSQL (which is the name of my ODBC connection with external database)
and below:
[MSSQL]
Driver=/path-to-my-driver/..
Server= IP address were is my external database
Port=default MsSQL port
Database=the name of my external database
That didn't work then I tried:
ODBCINI=/home/administrator/.odbc.ini
export ODBCINI
LD_LIBRARY_PATH=/usr/cachesys/bin
export LD_LIBRARY_PATH
But that didn't work either.
When I try to create new gateway connection I get the following error.
ERROR #6022: Gateway failed: DSN/User Connect.
And at the end that is the way I am trying to read the external MsSQL database. Unfortunately without any luck
by now.
S dsn="MSSQL", usr="username", pwd="password"
S gc = ##class(%Library.SQLGatewayConnection).%New()
S sc = gc.Connect(dsn,usr,pwd,0)
I hope you can give me some advice and point me my mistakes. Any help will be deeply appreciated.
P.S. Excuse my bad English. If something is not explained well enough please let me know.
Thank you again,
Pavel