Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle asp 0040 connection problems 1

Status
Not open for further replies.

colin81

Technical User
Jul 22, 2002
77
GB
Hi All

I am currently experiencing problems connecting to an oracle database using the below in an asp page :

<%@Language="vbscript"%>
<%Option Explicit%>

<%

Dim OraSession
Dim OraDatabase
Dim OraDynaset

Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.DbOpenDatabase("databasealias", "username/password", cint(0))
Set OraDynaset = OraDatabase.DbCreateDynaset("SELECT CaseNo FROM DCAPR", cint(0))

If Not OraDynaset.Bof Then
OraDynaset.MoveFirst
Do While Not OraDynaset.EOF
Response.write OraDynaset.Fields("CaseNo") & "<br>"
OraDynaset.MoveNext
Loop
End If

%>

I recieve the following error when attempting to run this script :

Error Type:
Oracle Automation (0x800A01B8)
Unable to make connection, ORA-12638: Credential retrieval failed

However when I run the below this script first (and i found this out totally by fluke) the script will execute and retrieve data from my oracle data ??????

<%@Language="vbscript"%>


<%


'Constants
adCmdUnknown = 0
adCmdText = 1
adCmdTable = 2
adCmdText = 1
adParamInput = 1
adParamOutput = 2
adInteger = 3
adUseClient = 3
adOpenStatic = 3


Dim cnnOracle, cmdStoredProc, rsEmp, objProp, objRS, objCommand


Set cnnOracle = Server.CreateObject ("ADODB.Connection")
cnnOracle.CursorLocation = adUseClient

'OLE DB connection
'strConn = "Provider=OLEDB.oracle; Data Source=source; User ID=user; Password=pword"
strConn = "Provider=MSDAORA.1; Data Source=data; User ID=user; Password=pword"

cnnOracle.Open strConn

Set objCommand = Server.CreateObject("ADODB.Command")

objCommand.ActiveConnection = cnnOracle
objCommand.CommandText = "DCAPR"
objCommand.CommandType = adCmdTable

Set objRS = objCommand.Execute

%>


Can anyone tell me whats going wrong here an how to resolve this problem ? I wish to use the 0040 approach as the second script doesnt recognise the data type.

Many thanks
Colin
 
Hi,
The probable cause of this Problem is due to Net 8 auth services.

Net8 has various authentication services available. By default, the SQLNET.AUTHENTICATION_SERVICES parameter has been set to enable the Windows NT native authentication service (NTS). This setting is incompatible with OO4O,
ODBC, IIS and Windows 2000.

In order to correct this follow below mentioned steps:

1. Open the SQLNET.ORA file located in the <Oracle Home>\network\admin directory.

2. Change the following parameter to NONE:

SQLNET.AUTHENTICATION_SERVICES=(NONE)

Do not comment out this parameter as it will take the default value of NTS.

3. Save changes to the SQLNET.ORA file.

4. Stop and restart the web site via the Internet Information Services (IIS) Plug-In which can be found in the Microsoft Management Console (MMC).

Note: If experiencing the same problem, then shutdown and reboot the computer.

HTH
Regards
Himanshu
 
Thanks for your reply that worked straight away.

Once again many thanks for your help

Colin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top