by Jim
Aug 17, 2011 9:06 AM
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.0.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies
For me the solution to this error was simply this: run my .NET website under IIS, rather than under Visual Studio’s development server. There are apparently other sources of this error, maybe related to x86 vs. x64 installations; IBM has some documentation of the error types.
If I had to guess, I would think that the IBM driver DLLs are trying to read from the registry, and the development server doesn’t have the necessary permissions. Reason code 7 is a registry error, and the tokens are an existing registry value and path under HKEY_LOCAL_MACHINE.