ODBC: Driver’s SQLSetConnectAttr failed
Today I ran into a very strange problem with one of my web app’s. After migrating it to a new server, a ODBC link stopped working. The only differences between the two servers were the OS: XP on one and 2003 R2 on the other.
The error’s weren’t telling me much:
ERROR [HYC00] [MERANT][ODBC SQLBase driver]Optional feature not implemented.
ERROR [HY000] [MERANT][ODBC SQLBase driver][SQLBase]00134 SQL CNO ERROR.SQL NOT FOUND LOOKING UP ERROR 09293
ERROR [IM006] [MERANT][ODBC SQLBase driver]Driver’s SQLSetConnectAttr failed.
ERROR [HYC00] [MERANT][ODBC SQLBase driver]Optional feature not implemented.
ERROR [HY000] [MERANT][ODBC SQLBase driver][SQLBase]00134 SQL CNO ERROR.SQL NOT FOUND LOOKING UP ERROR 09293
ERROR [IM006] [MERANT][ODBC SQLBase driver]Driver’s SQLSetConnectAttr failed.
After trying a lot of different things, the solution was quite simple. Because IIS uses app pools under 2003, the application was running under the “Network Service” account. This account didn’t have enough rights to read the ODBC files (sql.ini and some dll’s). You can solve this by granting the account rights to the files needed (depends on your database manufacturer which you need) or using a dedicated application account to run your application (which I prefer) which has read-only rights to your filesystem (or at least the folders where your config / dll files reside).
Be carefull granting rights to a web application which is available through the Internet! Less is more!
Leave a Comment