richardschoen / MonoOniSamples

Mono on IBM i Code Samples. Samples may be C#, VB, RPG or CL. Time will tell.
5 stars 0 forks source link

Error while testing MonoOdbcConnect #1

Closed ToddMason closed 5 years ago

ToddMason commented 5 years ago

I'm getting the following when trying to run MonoOdbcConnect.

mono MonoOdbcConnect.exe "DSN=LOCAL;UID=muser;PWD=mypass;" "select from qiws.qcustcdt"


MonoOdbcConnect Program Start 6/28/2019 7:32:25 AM
TimeZoneInfo.Local Offset:-06:00:00
TimeonInfo.Local UTC Time:6/28/2019 7:32:25 AM
Connection String:DSN=LOCAL;UID=TMASON;PWD=POKEY3;
SQL query: select
from qiws.qcustcdt
Message:Dependency unixODBC with minimum version 2.3.1 is required.
libodbc.so.2
Stacktrace: at System.Data.Odbc.OdbcConnection.Open () [0x0004b] in <33e1513e28564b22bb751dc822b20e82>:0
at MonoOdbcConnect.MonoOdbcConnect.Main (System.String[] args) [0x000dc] in <2164350f82424253b1514961baa9c967>:0
MonoOdbcConnect Program End 6/28/2019 7:32:25 AM

When I run the following everything looks good. isql --version unixODBC 2.3.4

I can also connect and run the following query from QP2TERM. select * from qiws.qcustcdt. so I THINK the ODBC driver is in good shape.

Thanks in advance for any insights you have.

richardschoen commented 5 years ago

Try this: Set Up Mono ODBC DLL config mapping -ODBC will throw errors without this setting -Edit mono dll config map file -WRKLNK ‘/qopensys/pkgs/etc/mono/config ‘ -Add DLL map entry for the IBMi Access PASE ODBC Driver <dllmap dll="i:libodbc.so.2" target="libodbc_64.o" os="aix"/> -Exit and save the config file

ToddMason commented 5 years ago

Thanks for your help. My problem is I had installed with the SAVF version. I reinstalled with YUM and it works great.