none
ODBC error for IIS7 RRS feed

  • Question

  • While running my Asp.net  application in IDE it works good. But Why i am getting "ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" error while hosting an Asp.net 2008 Web application in IIS7. The database is in MS Access 2007. Please give me correct solution. Thanks in advance.

    Sunday, October 23, 2011 4:35 PM

Answers

  • If your machine is all 32-bit then the answer is simple.  IIS cannot find your driver or the DSN.   If the same code works outside of IIS, ensure you are connecting to a system DSN and not a user DSN.  A user DSN is per logged in user and IIS will not be using the same user than you.
    Matt
    Monday, October 24, 2011 6:51 PM
    Moderator

All replies

  • This error #1 means your connection string refers to a data source name (DSN) that cannot be found.

    Look at your connection string and identify the name of the DSN.  Typically you will see DSN=Blah;

    Then open up ODBC Administrator (Run odbcad32.exe) and ensure you have a matching DSN under the System tab.

    Note the ODBC administrator tool is a bit confusing on a 64-bit machine, be sure to run both of these and verify System tab has the DSN defined.

    c:\windows\system32\odbcad32.exe

    c:\windows\syswow64\odbcad32.exe

    #2 it could mean you have a 64-bit IIS and 32-bit Access driver will not work.  Download and install 64-bit version of this driver -> Microsoft.ACE.OLEDB.12.0 and it will work.


    Matt
    Sunday, October 23, 2011 6:02 PM
    Moderator
  • Thanks Matt. My system is with Windows 7 Home premium 32 bit OS. So obviously IIS is also of 32 bit. I got a doubt that did 64 bit Microsoft.ACE.OLEDB.12.0 driver get installed on 32 bit OS by any chance?  
    Monday, October 24, 2011 4:30 PM
  • If your machine is all 32-bit then the answer is simple.  IIS cannot find your driver or the DSN.   If the same code works outside of IIS, ensure you are connecting to a system DSN and not a user DSN.  A user DSN is per logged in user and IIS will not be using the same user than you.
    Matt
    Monday, October 24, 2011 6:51 PM
    Moderator
  • Firstly you thank you.

    I have been so frustrated about the same problem after moving over from iis6 to 7.

    The fix for me was running bot from the command line as the 32 bit version is the one that runs from the menu.

    If anyone is having the same issue i suggest you run both

    c:\windows\system32\odbcad32.exe  and

    c:\windows\syswow64\odbcad32.exe

    Did the trick for me.

    Cheers

    Rob

    Thursday, March 20, 2014 6:25 PM
  • thank you very much Mr. you solve my problem
    Saturday, July 19, 2014 4:42 PM