Uncategorized

Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed

Another weird one I got this afternoon. A colleague from the Sql team asked my help about what looked an authentication problem is customer’s web application, while trying to connect to a Lotus Notes database: in short, the customer was developing his application with Visual Studio 2005 and was testing it with Cassini, and everything looked fine, but as you can guess the problem arose when he deployed the site on his test IIS. They got the error [IM005] Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed.

The first thought was about a permission problem, since as you may know one of the main differences between IIS and Cassini is that the latter is essentially a process which runs in the context of the account logged on the machine, while IIS is a service which runs under different accounts but with lower privileges. Ok then, to verify this hypotheses we made a quick change to the <processModel> section to have the worker process running under the customer’s account instead of the default ASPNET (he was testing on his local IIS 5.1 on XP). Well… same problem. So that could not be a security problem, ASP.NET was running as an administrator… ?

The error message clearly refers to an ODBC problem, and a quick research in our internal docs showed that usually this is due to an installation/configuration problem in the involved driver. In this specific case, the customer was using NotesSql 3.02 he downloaded from the IBM site.

We decided to use Filemon and Regmon to get an idea of what was happening at file system and registry level and compare the two situations (working and not working); after some digging into the logs, we found that when the application was working fine it was looking (and loading) for notes.ini under the user’s folder profile (c:\documents and settings\account\…), while in the failing situation we saw some king of probing but the application was not able to find the file… We decided to move the notes.ini from it’s location to the Notes driver’s installation folder, and that did the trick! ?.

Carlo

Quote of the Day:
At the working man’s house hunger looks in but dares not enter.
–Benjamin Franklin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.