Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: OO4O: ORA-12154 Error - TNS:could not resolve the connect identifier specified

Re: OO4O: ORA-12154 Error - TNS:could not resolve the connect identifier specified

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Wed, 27 Sep 2006 13:13:05 GMT
Message-ID: <J6962F.9o6@igsrsparc2.er.usgs.gov>


CJM wrote:
> I have a working web application (ASP) which links to an Oracle 10g DB via
> OO4O. I'm trying to port it to either of two test servers, but in fact, I
> can't get it to work with either - 'Unable to make connection, ORA-12154:
> TNS:could not resolve the connect identifier specified'. This error occurs
> in the applications global.asa file where I'm trying to set up a connection
> pool:
>
> <object runat="Server" scope="Application" id="oSession"
> progid="OracleInProcServer.XOraSession"></object>
>
> <script runat="server" language="vbscript">
> Sub Application_OnStart
>
> oSession.CreateDatabasePool 2, 40, 200, "IFSP2", "uid/pwd", 0 <==
> error occurs here
>
> End Sub
> </script>
>
> I'm not sure where I have gone wrong. I originally installed the
> InstantClient (and ODBC add-on) on it's own. I created SQL.ORA and
> TNSNAMES.ORA files, and the NLS_LANG and TNS_ADMIN environment variables and
> I prepended the Path environment variable with the path to the top-level
> oracle folder. So far so good - I can create a DSN which connects to the DB
> OK, and Oracle SQL Developer recognised the TNS names I supply and can
> connect to the DB that way too.
>
> I then installed the Oracle .NET tools package, which includes within it
> Oracle Objects for OLE. The installation proceeded as expected, but short of
> getting my application to work, I dont know of any way to confirm that it is
> working.
>
> The application itself is using Anonymous authentication for the time being,
> though it will eventually be using Integrated Windows Authentication, so I
> cant see the any problems server-side. What is more, I assume that OO4O is
> reading the TNS names in the same way that the ODBC Administrator and Oracle
> SQL Developer do, which makes this problem even more curious.
>
> I've also tried the code listed below to see if a straight-forward
> connection (as opposed to pooling) would work but it didnt.
>
> Any thoughts?
>
> Thanks in advance.
>
> Chris
>
>
> Test.asp:
>
> <%@ Language=VBScript %>
> <%
>
> Option Explicit
> Response.Expires = 0
>
> Dim OraSession
> Dim OraDatabase
> Dim rsEntryTypes
>
> %>
> <!-- #include virtual='/common/oo4oglobals.asp' -->
> <%
>
> Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
> Set OraDatabase = OraSession.DbOpenDatabase("IFSP2", "uid/pwd",cint(0))
>
> Response.Write "Connected to " & OraDatabase.Connect & "@" &
> OraDatabase.DatabaseName
> Response.Write "OO4O Version: " & OraSession.OIPVersionNumber
> Response.Write "Oracle Version: " & OraDatabase.RDBMSVersion
>
> Response.Write "End"
> Set OraSession = nothing
> Set OraDatabase = nothing
> %>
>
>

I'm not an expert with ASP, but is IFSP2 the TNS entry you are using to denote the database to connect to? If so, then verify that it is defined correctly in your TNSNAMES.ORA configuration file. Also, verify that you can TNSPING that entry, "tnsping ifsp2". If not, then you have either 1) configured your tnsnames incorrectly, 2) have an incorrect sqlnet.ora configuration file, or 3) your software cannot see these files.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Wed Sep 27 2006 - 08:13:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US