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: Oracle & ASP, connection problem

Re: Oracle & ASP, connection problem

From: sybrandb <sybrandb_at_yahoo.com>
Date: 12 Jul 2006 01:08:28 -0700
Message-ID: <1152691707.823132.88900@h48g2000cwc.googlegroups.com>

caiusmeridius_at_go2.pl wrote:
> Hi!
>
> I've a problem I cannot solve. I'm trying to connect to Oracle using
> ASP, when I try to open connection I get "ORA-12640: Authentication
> adapter initialization failed". I tried to change connection strings,
> OleDB drivers, ODBC drivers, nothing works. Interesting thing is when I
> use ASP.NET everything works fine (unfortunately I can't write the
> whole application in .NET).
> Oracle server version is 8.1.7.0, OS WinXP, P4 processor.
>
> This is the code with the error.
>
> <%@ Language="VBScript" %>
> <% Option Explicit %>
>
> <%
> const CONNECTION_STRING = "Provider=msdaora;Data
> Source=mydatabase;User
> Id=xxx;Password=xxx;"
> const adModeReadWrite = 3
> const adModeRead = 1
> dim objConn
> dim objRecordSet
> %>
>
> <%
> Function getConnection(ConnectModeEnum)
> Dim OConnection
>
> Set Oconnection = Server.CreateObject ("ADODB.Connection")
> Oconnection.Mode = ConnectModeEnum
>
> Set getConnection = OConnection
> End Function
>
> Sub OpenConnection(Oconnection)
> Oconnection.Open CONNECTION_STRING <== here I get ORA-12640
> End Sub
> %>
>
> </HTML>
> <BODY>
> <%
> Response.Write(CONNECTION_STRING)
> Set objConn = getConnection(adModeRead)
> OpenConnection objConn
> %>
> </BODY>
> </HTML>
>
> This ASP.NET code works fine.
> <%
> const CONNECTION_STRING = "Provider=msdaora;Data Source=mydatabase;User
> Id=xxx;Password=xxx;"
>
> dim conn As New OleDBConnection()
> conn.ConnectionString = CONNECTION_STRING
> conn.Open()
> if (conn.State = System.Data.ConnectionState.Open) then
> Response.Write("I'm connected.")
> else
> Response.Write("I can't connect.")
> end if
> %>
>
> Anybody have any idea?
>
> Greetings
> Rafal

You have two files named tnsnames.ora and sqlnet.ora on your system (in %ORACLE_HOME%\network\admin).
In the latter file you have a line reading sqlnet.authentication_services=(nts)

This means you force Oracle to contact the PDC or BDC in your organization.
This attempt fails.
Either fix this problem
or edit the file and change NTS in NONE.

Hth

-- 
Sybrand Bakker
Senior Oracle DBA'
Received on Wed Jul 12 2006 - 03:08:28 CDT

Original text of this message

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