Just wondering if there is any official documentation for unixODBC, e.g. how the configuration files have to look like and what parameters they expect? (I am using only a shell, no GUI) Even http://www.unixodbc.org/doc/ doesn't look very promising. I somehow have the impression, the best information are 3rd party pages, but can this be true?


You're right the documentation about unixODBC still rare. For the configurations files, unixODBC use only two config files:

  • /etc/odbcinst.ini : Here you define the driver

  • /etc/odbc.ini : Informations about connections

You can find a great documentation about installing this drivers and libraries on various linux systems here:


More complete documentation that include API for various languages can be found here:


All the config and installation stuff can be made without GUI :), an old good terminal shell suffice.

From a developer point a view (iused the C API few years ago, and i remember that it was a non trivial task): you need to connect and then perform a request.

  1. To connect to the datasource using unixODBC and the C API:

    • Init ODBC environnement by calling SQLAllocHandle()

    • Choose ODBC version number with SQLSetEnvAttr()

    • Again use SQLAllocHandle() to init the connection handle

    • Now you can connect by calling SQLConnect()

  2. Once you have a connection handle and have connected to a data source you allocate statement handles to execute SQL or retrieve meta data. As with the other handles you can set and get statement attributes with SQLSetStmtAttr and SQLGetStmtAttr.

here you can find a good documentation on the C API:

http://www.easysoft.com/developer/languages/c/odbc_tutorial.html http://www.easysoft.com/developer/languages/c/odbc-tutorial-fetching-results.html http://www.easysoft.com/developer/interfaces/odbc/diagnostics_error_status_codes.html

| improve this answer | |
  • thank you very much TOC, I don't need it for programming, just for asterisk, where your link comes in handy, great :-) – stefan.at.wpf Aug 19 '12 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.