Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Strange ODBC error
Hello,
I have made an ASP.NET application that connects to an Oracle database through ODBC. When I run the application in my development environment, it works fine, but when I run it in the customers test-environment, I get the following ODBC error message:
ERROR [08001] [Microsoft][ODBC driver for Oracle][Oracle]ORA-12154:
TNS:could not resolve service name
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed
I have googled for this error, and it seems to be a very common Oracle problem - usually caused by a missing clause in the tnsnames.ora file. I don't think the tnsnames.ora file has anything to do with the error I experience, though. Mostly because the error does not occur the first time the application accesses the database. The first SQL I send seems to work fine - at least it does not result in an error - but the second SQL returns the error above (both are very simple SELECT statements).
I tried sending the exact same SQLs from a desktop application using the same ODBC connection, and they worked fine, so it must be the combination of Oracle and ASP.NET that gives the error.
In my development environment I run Oracle 8.1, and the customer runs Oracle 9.2. Could that make a difference?
Could the error message actually cover for another error, such as insufficient rights to the tables or a missing field in a table? Except if that was the case, then the desktop application should have experienced the same problem.
Unfortunately, I do not have the possibility of debugging in the test-environment - not that that would help me much; I already know where the error occurs in the code.
I have absolutely no idea what the problem could be - I hope that someone can give me a hint, or just something that I could try...
Regards,
Asger
Received on Fri Sep 22 2006 - 07:42:41 CDT
![]() |
![]() |