Web method accessing local odbc

I wrote a simple web application that has only one web method that accesses the local odbc on the server. When I call the web method from a client application, I keep on getting the following error:

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

The odbc connection on the server works fine, and the dsn I put in the code is correct. I guess it has something to do with the environment, but I don't know how it can be fixed. Does anyone have any idea Thanks!


Answer this question

Web method accessing local odbc

  • Meng CHew

    I actually didn't set the DSN as a System DSN. Now the problem is solved. Thank you!

  • Surjeet Thakur

    I assume your DSN is a System DSN and not a User DSN, yes  Is the database driver associated with your DSN an Oracle driver I've found that the ASPNET user generally doesn't have access to the oracle directories and/or the ODBC registry keys after a default installation, and can cause the error you are getting.  Additionally, sometimes after changing the NTFS permissions on the oracle directories and/or registry keys, you need to reboot for the changes to take effect.

    When you say 'local', you do mean local to the web server and not local to the web client, correct Web services won't have any access to a web client's odbc configuration.

     


  • Web method accessing local odbc