IBM Support

"IBMDADB2 is not registered" error when using IBM DB2 OLE DB provider with ASP.NET

Question & Answer


Question

[

You may receive an "IBMDADB2 is not registered" error message when attempting to run an ASP.NET application with DB2® and the IBM® OLE DB provider (IBMDADB2). Using the same provider with a stand-alone Windows® application works, however.

]

Cause

You need to ensure that the IBMDADB2 provider is registered with the operating system, and that the proper permissions are met for the ASP.NET and IUSR_### accounts on the system.

Answer

The IBM OLE DB Provider should be registered during installation of the DB2 Universal Database™ (DB2 UDB) product. If you receive this error, however, here are the steps to take to ensure the driver is registered:

  1. At a command prompt, type the following:
    regsvr32.exe /c "C:\Program Files\IBM\SQLLIB\BIN\ibmdadb2.dll"
    (where <C:\Program Files\IBM\SQLLIB\BIN\> is the location of the ibmdadb2.dll on your system)
  2. Once this is complete, you will also need to ensure that both the ASP.NET and IUSR_### user accounts on the system have READ, WRITE, EXECUTE, and LIST FOLDER CONTENTS privileges on the C:\Program Files\IBM\SQLLIB directory in the machine on which you are running your ASP.NET application. To do that, open your Windows Explorer, and drill down to your SQLLIB directory. Then right-click and choose "Properties". Here you can then click on the "Security" tab and modify the privileges as needed. If Extended Windows Security is enabled, this can also be achieved by adding the user to the DB2ADMNS or DB2USERS group.
  3. It is recommended that once the proper privileges are set, that you recycle your ASP.NET application server, so the new changes take effect.

If the application is running on a 64-bit Windows machine, then it is important to use the proper regsvr32.exe utility. There is a regsvr32.exe utility for both 32-bit and 64-bit applications as described here.


The 32-bit regsvr32.exe utility is located in %SystemRoot%\Syswow64 directory (eg, C:\Windows\Syswow64) on a 64-bit Windows machine.


The 64-bit regsvr32.exe utility is located in %SystemRoot%\System32 directory (eg, C:\Windows\System32). This is the default one on 64-bit machines but should only be used with the 64-bit IBM OLE DB provider. This is also the location of the utility on a 32-bit Windows machine.

The 64-bit IBM OLE DB provider is called ibmdadb264.dll and is located in the same directory as the 32-bit IBM OLE DB provider (ibmdadb2.dll). If you need to register the 64-bit IBM OLE DB provider than in step 1 above, please use ibmdadb264.dll instead of ibmdadb2.dll.

If compiling an application with Microsoft® Visual Studio, then make sure that the Property value x86 is used instead of anyCPU when trying to compile a 32-bit application. A value of anyCPU or x64 will compile the application as 64-bit on a 64-bit version of Windows.

If regsvr32.exe does not resolve this problem, then further trouble shooting would be required. One example could be that the Windows registry for DB2 might be corrupted, and a re-install of the DB2 product might be required.

A useful tool for trouble shooting an error like this is to use Microsoft Process Monitor, which can track both file and registry operations. This can help identify which registry entries are missing or if there is a file permission issue that causes the problem.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming Interface - Other","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;10.1;10.5;11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21219288