Connection from ASP to Oracle 10g database
591264Aug 2 2007 — edited Oct 1 2010Hi,
I have Oracle Client on my machine. I used SQl * Plus to connect the to the development instance Oracle.
Using classic ASP (not ASP.Net), I am trying to connect to the database.
I get errors:
Hi,
I am trying to connect from ASP to an Oracle 10g database. I got a sample connection string from www.connectionstrings.com
I get an error message which I have attached along with this post. It is alert box with the message that says - ""
In the browser, I get the following error:
The Oracle (tm) client and networking components were not found. These components are supplied by Oracle Corporation and are a part of the Oracle Version 7.3 (or greater) client software installation.
You will be unable to use this driver until these components have been installed.
In the browser, I get the error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
/test/Oracle_DB.asp, line 7
My code is:
Oracle_DB.asp
CODE
<%@Language="VBScript"%>
<%
' Create the Connection Object
Set objConn = Server.CreateObject("ADODB.Connection")
' Set the connection string. Connecting to a SQL Server Database
objConn.open "Driver={Microsoft ODBC for Oracle};Server=skydev;Uid=apps;Pwd=apps;"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Oracle DB Connection</title>
</head>
<body>
<form name="frmNorthwind" id="frmNorthwind" action="getProductResults.asp" method="post">
<h1>Product Search</h1>
<h4>Search Product</h4><input type=text size=20 id="txtProduct" name="txtProduct">
<input type="submit" name="btnSubmit" id="btnSubmit">
</form>
</body>
</html>
<%
objConn.Close
%>
Line 7 is:
CODE
objConn.open "Driver={Microsoft ODBC for Oracle};Server=skydev;Uid=apps;Pwd=apps;"
Note: On my local machine, I have been able to connect to the same database from a JSP page.
Any ideas how to get the connection right from ASP page?
Thanks.