Frustrated webdeveloper needs ODBC/ASP connectivity help
538640Oct 10 2006 — edited Nov 2 2006I've spent the better part of a day scouring the web and these forums for simple, cut and dry instructions on what I need to connect to an Oracle database from my Windows box using ASP (not ASP.NET mind you).
I've connected many a web app to Microsoft SQL Server databases and Microsoft Access databases without problems, but connecting to an external Oracle database is driving me up the wall. Here are the details:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1) I'm running Windows Server 2003 SP1 as my webserver
2) Using ASP (not ASP.NET) & VBscript
3) In the webserver's ODBC Data Source Administrator window, on the Drivers tab, I already show that Microsoft ODBC for Oracle (version 2.576.1830.00) is installed
4) The administrator of the Oracle database to which I want to connect has created a username and password for me to use from within my code
5) Here is the code I am trying to run (XXXXXX's replace the actual server name, username and password, obviously). The oracle admin provided me with the SQL string.
<%
Dim objConn, rs
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={Microsoft ODBC for Oracle};Server=XXXXXX;Uid=XXXXXX;Pwd=XXXXXX;"
lssql="select lastname from userTable where primarykey = '1'"
set rs=objConn.execute(lssql)
Response.Write rs("lastname")
objConn.Close
%>
6) Hitting this webpage brings up the following error (being thrown on the line starting with "objConn.Open" :
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Can anyone lend a hand? Is there additional software I need to install on the webserver? I honestly only need to connect to the Oracle database to run one single, simple query, and that's it. Any help would be very much appreciated!