Hi!
I’m trying to access the remote MS SQL database with the programmatic interface implemented on Xojo (IDE version 2019r2, Linux Mint 20.2) without any success.
As the following section of the app’s code is executed in Xojo debugger - the application freezes and runtime can’t be paused:
query = New ODBCDatabase
query.Timeout = 60
query.DataSource="TEST_DSN"
Try
query.Connect
Catch err As DatabaseException
error = "The error occured during connecting to the database: "+Err.message
End try
The OCDB driver was installed and configured according to Microsoft instructions . Connection was tested via terminal commands:
isql -v TEST_DSN user pass
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
Content of configuration files
/etc/odbc.ini
[TEST_DSN]
Database=db_name
Driver=ODBC Driver 18 for SQL Server
Server=tcp:417.211.423.324,1433
UID=user
PWD=pass
Encrypt=No
TrustServerCertificate=Yes
~/.odbc.ini is the same as /etc/odbc.ini
/etc/odbcinst.ini content:
[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.0.so.1.1
UsageCount=1
[ODBC]
Trace = Yes
TraceFile = /home/user/odbc_log
The confusing part is that I could catch an exception with Xojo debugger when I intentionally change Driver=ODBC Driver 18 for SQL Server with incorrect one, but not in cases with an incorrect IP or db name:
[iODBC][Driver Manager]FAILODBC Driver 18 for SQL Server: cannot open shared object file: No such file or directory
Any help would be greatly appreciated!