error to connect ASP page to Oracle
am 22.09.2005 03:05:54 von jrefactorsMy 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 "
" & objRS(I).Name & " | "
objRs.Close
objConn.Close
%>
any ideas? please advise.
thanks!!