How to connect to SQL Server in Altair SLC on MacOS
I am trying to connect to SQL Server on MacOS. I am getting this error:
ERROR: Could not load SQLSERVR engine or one of its dependent libraries. Please ensure that youhave installed the relevant client libraries for connecting to SQLSERVR and that they canbe located by Altair SLC before trying to connect.
I can access the database from VSCODE and from the terminal. ODBC is configured, I can locate the driver path through odbcinst -j command. I tried changing /etc/odbc.ini as recommended in one of the community blogs but it didn't help.
I checked Proc SETINIT and confirmed that SQLSERVER is an available option.
Product: Altair Analytics Workbench Version: 5.23.7.0.520-GA-release
Any help will be greatly appreciated.
PROC SQL;
CONNECT TO sqlservr(
server='some-server.database.windows.net'
port=1433
driver='ODBC Driver 18 for SQL Server'
database='mydb'
user='myuser'
password='mypassword'.
encrypt='yes'
);
SELECT * FROM CONNECTION TO sqlservr(
SELECT 1 AS TestConnection
);
DISCONNECT FROM sqlservr;
QUIT;
Answers
-
The error message…
ERROR: Could not load SQLSERVR engine or one of its dependent libraries
…essentially means that SLC didn't find the expected shared libraries on DYLD_LIBRARY_PATH.
There are many places you could set/modify DYLD_LIBRARY_PATH but a good recommendation for SLC would be: You can create a script called/Applications/altairslc.app/altairslcenv.sh
containing the necessary command for updating that environment variables. You might want to set ODBCINI and ODBCSYSINI as well as DYLD_LIBRARY_PATH in that script.n.b. SLC needs to find the unixODBC libraries on DYLD_LIBRARY_PATH as well as the SQLServer ODBC libraries that ought to be found via the odbc .ini files.
0