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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conecting to an oracle database using 0040 ole

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=acollive; User ID=acolaid; Password=nosredna"
strConn = "Provider=MSDAORA.1; Data Source=acollive; User ID=acolaid; Password=nosredna"

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top