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 -> error to connect ASP page to Oracle

error to connect ASP page to Oracle

From: <jrefactors_at_hotmail.com>
Date: 21 Sep 2005 18:05:54 -0700
Message-ID: <1127351154.645945.49200@g49g2000cwa.googlegroups.com>


My machine is Windows XP with Oracle 9.2 Home; IIS and Oracle are in the same box.

I have tried both Oracle OLEDB Provider and Microsoft ODBC For Oracle, but both not working.

For Microsoft ODBC For Oracle approach, I added a data source in Oracle Data Source Administrator, in System DSN tab, I created a system data source named OracleDSN with Microsoft ODBC for Oracle.

I got the following errors for ASP page connect to Oracle database. However, it works fine for VB application connect to Oracle database with the same data source.

Approach #1: Oracle OLEDB Provider


  cst = "Provider=MSDAORA;" & _

"Data Source=ORCL;" & _
"User ID=scott;" & _
"Password=tiger;"
Error Type: Microsoft OLE DB Provider for Oracle (0x80004005)
Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation. Provider is unable to function until these components are installed.

Approach #2: Microsoft ODBC For Oracle


 cst = "dsn=OracleDSN;uid=scott;pwd=tiger;"

 Error Type:
 Microsoft OLE DB Provider for ODBC Drivers (0x80004005)  [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

Here's the ASP code:
<%

     Set objConn = Server.CreateObject("ADODB.Connection")

     'Approach #1: Oracle OLEDB Provider
     cst = "Provider=MSDAORA;" & _

"Data Source=ORCL;" & _
"User ID=scott;" & _
"Password=tiger;"
'Approach #2: Microsoft ODBC For Oracle 'cst = "dsn=OracleDSN;uid=scott;pwd=tiger;" objConn.Open cst Set objRs = objConn.Execute("SELECT * FROM DEPT") Response.Write "<table border=1>" For I = 0 To objRS.Fields.Count - 1 Response.Write "<tr>" Response.Write "<td><b>" & objRS(I).Name & "</b></td>" Response.Write "</tr>" Next Response.Write "</table>" objRs.Close objConn.Close

%>

any ideas? please advise.

thanks!! Received on Wed Sep 21 2005 - 20:05:54 CDT

Original text of this message

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