Connecting mdb Database via ODBC in linux lazarus / 16-Databases ---------------------------------------------------------------------- jluix · 2007-03-10 17:29 Hi! I've been working with Lazarus under Windows the last two years, and now I'm starting to work in linux (ubuntu 6.10) so, I want to re- compile all my proyects to this new O.S. My problem is that I don't know how to link via ODBC with databases (the proyect I want to migrate now is linked to M$ Access database). The first I did was to install unixODBC and mdbtools package (that comes with and Access ODBC called libmdbodbc.so.0). Then I wrote /etc/odbcinst.ini as I saw in a web with: [Microsoft Access Driver (*.mdb)] Description = MDB Tools ODBC drivers Driver      = /usr/lib/libmdbodbc.so.0 Setup       = FileUsage   = 2 CPTimeout   = CPReuse     = and the /etc/odbc.ini with: [Cofinanza] Description = Base de datos de Cofinanza Driver      = Microsoft Access Driver (*.mdb) Database    = /home/jluix/Proyectos_Lazarus/Cofinanza/Cofinanza.mdb Servername  = localhost Obviously, Cofinanza.mdb is the database I want to access. In ODBCConfig I can see now the result of previous sentences but, when I try run my program with the next lines (that work fine in windows):           ODBC.Driver:='Microsoft Access Driver (*.mdb)';           ODBC.Params.Add('DBQ='+Param1);           ODBC.Params.Add('PWD='+Param2)           .....           ODBC.Connected:=True; I got an error message: Project raised exception class 'EInOutError' with message: Can not load ODBC client. Is it installed? (libodbc.so). I've been browsing a lot for the solution but I'ven't got luck. Could you help me?. Many thanks. ---------------------------------------------------------------------- bram · 2007-05-01 22:17 Try to install the unixodbc-dev package as well: Code: [Select]aptitude install unixodbc-dev This adds the correct symlink libodbc.so in /usr/lib. I do not know the exact cause, but it might have to do with giving you the option to choose between iodbc and unixodbc (iodbc is an alternative ODBC driver manager). Note: I only tested odbcconn with unixodbc. ---------------------------------------------------------------------- bram · 2007-05-01 22:24 And if you don't want to pull in the unixodbc-dev dependencies (e.g. on a debian server), you can add the link yourself: Code: [Select]ln -s libodbc.so.1.0.0 /usr/lib/libodbc.so