got an error while running the report

The issue was there is this ODBC Key in the registry, the current user
did not have read permission to read the key and the key told ASPNET
where the db2 odbc driver was, so as we cannot read the key we cannot
use the driver and hence cannot open a connection

  • An
    error has occurred during report processing.
    • Cannot
      create a connection to data source ‘NDB_MIG2’.
      • ERROR
        [IM003] Specified driver could not be loaded due to system error 5 (IBM DB2 ODBC

      Here is the solution
      1) I use DB2, ASP.Net with SSRS
      2) DSN is created in ODBC and sits on windows dsn,
      Run regedit and go to HKEY_LOCAL_MACHINE >> SOFTWARE >>
      ODBC >> ODBC.INI >> select the name of the dsn >>
      Right click permissions >> Add the user name underwhich IIS runs
      (or) the current logged in user and give him read access (i gave full

      4) Open mycomputer >> properties >>
      advanced tab >> Environmental Variables >> click path and
      add ;.; to the existing path at the end.
      5) Restart the machine, since it is a odbc change we need to restart pc.