The iODBC Framework includes a command line application called "iodbctest" that can be used to connect to ODBC data sources. If you use this application to connect to a 4D v11 SQL database you may find that it is not responsive. This is because of a bug in iodbctest.
The iodbctest application calls the ODBC function "SQLDriverConnect" with the argument SQL_DRIVER_PROMPT. This argument is used to specify that the ODBC driver being connected to should prompt the user for additional information if anything is missing from the connection string, for example if a user name was not specified. However, it is the responsibility of the calling application, in this case iodbctest, to provide a valid window handle to the ODBC driver so that the driver has a window in which to display its dialog requesting the information. Unfortunately the iodbctest application provides no such window handle (it passes 0 for the pointer) so the connection fails.
To fix this problem.
- Download the iODBC source from:
- Extract libiodbc-3.52.6.tar.gz (note that the file name may be different as the version changes).
- Inside the "libiodbc-3.52.6" folder is a folder called "samples". This folder includes the source code for iodbctest ("iodbctest.c") as well as the necessary make files.
- Edit the "ODBC_Connect" function in "iodbctest.c", around line 300 and replace both instances of SQL_DRIVER_PROMPT with SQL_DRIVER_NOPROMPT.
- Install Apple Xcode Tools (I used 2.4.1).
- Build a new version of iodbctest with the command:
make -f Makefile.sample all
When you execute the new iodbctest make sure to prepend it with ./ otherwise the old one on the system path (from the iODBC installer) will be used. I.e.:
With these changes you should be able to connect to a 4D v11 SQL database and query the data from iodbctest.