Hi,
I think this is actually an iodbctest problem: iodbc: /usr/bin/iodbctest
I get the same errors as the original poster when using iodbctest to
connect to a MySQL database. However, my own application, using odbc++
on top of libiodbc2, works just fine with the same ODBC configuration.
Additional hints may be found in:
iodbctest tool fails to connect with mysql
<http://sourceforge.net/mailarchive/message.php?msg_id=11053109>
http://sourceforge.net/mailarchive/forum.php?thread_id=6724202&forum_id=40427
Also, these Debian bug reports appear to be related:
Bug#309935: iodbc: iodbc with libmysql stops with No DSN entered"
Bug#309936: iodbc: iodbc with libmysql stops with No DSN entered"
The problem is not in iODBC, but in the way the MyODBC driver handles
the SQL_DRIVER_PROMPT setting in the SQLDriverConnect call in iodbctest.
On Unix they do not have a graphical setup routine, so they
have the following code sequence:
if (no connect string entered)
fPrompt = TRUE;
else {
// Parse connect string
if (KEY_DSN) {
// read all key=value pairs from this DSN
}
if (fDriverCompletion == SQL_DRIVER_PROMPT ||
((fDriverCompletion == SQL_DRIVER_COMPLETE ||
fDriverCompletion == SQL_DRIVER_COMPLETE_REQUIRED) &&
(!KEY_DSN && !fDriver)))
fPrompt = TRUE;
}
if (!fprompt)
DBUG_RETURN (set_conn_error (hdbc, MYERR_S1000,
"No DSN entered", 0));
The problem is the check for fDriverCompletion. If it is set to
SQL_DRIVER_PROMPT it will set fPrompt = true. This causes the misleading
"No DSN entered" return code, even though the connect string provides a
DSN and all other parameters needed for connecting. Even though they do
not have a graphical setup function, it would have been better if they
had provided a separate error message, or just ignore the hint to prompt
and try the connection anyway.
A quick workaround it to change the iodbctest.c program and change the
SQL_DRIVER_PROMPT to SQL_DRIVER_COMPLETE. This patch will be in the
upcoming iODBC 3.52.3 release.
Best regards,
Patrick
--
Patrick van Kleef Email : <[EMAIL PROTECTED]>
Maintainer iODBC Web : <http://www.iodbc.org>
OpenLink Software
Universal Data Access & Data Integration Technology Providers
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]