ASP - Show oracle table with ODBC

Posted on 2003-03-06
Medium Priority
Last Modified: 2008-02-26
I am trying like a crazy man to make this work, but it just doesn't want. The problem I have, is that the web server and the oracle server are two different servers. The web server is a NT 4.0 and the oracle one is a Unix server. I am unable to establish a connection between those two. Is there someone who knows???

Here is the code i created and the error it generate.
 Dim OraSession
 Dim OraDatabase
 Dim OraDynaset

 set OraSession = server.createobject("ADODB.Connection")
 OraDatabase = "Driver={Microsoft ODBC for Oracle};" & "Server=dndp;uid=testing;pwd=hiver;"

 OraSession.open OraDatabase

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

/202daint/ASP_TEST/Oracle.asp, line 35
Question by:Wizmasterus
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 8082840
Do you have the Oracle client installed on the NT machine?  If not, install the Oracle client software, and set up your client networking to connect to the database instance on the UNIX server.

Accepted Solution

Bruce Cadiz earned 300 total points
ID: 8082885
Try Microsoft's OLE provider Driver for Oracle (I think it's in MDAC 2.5 or 2.6)

Try this:

Set conn = Server.CreateObject("ADODB.Connection")
    conn.ConnectionTimeout = 85
    conn.CommandTimeout = 85
    conn.open "Provider=MSDAORA;Data Source=dndp;User ID=testing; Password=testing;"
    Set Session("ado_conn1") = conn
Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open "Select USER from Dual", conn , 3, 3
    response.write "USER IS:" & rs.fields("USER").value
Set rs = nothing

Expert Comment

by:Bruce Cadiz
ID: 8083139
Also ensure you can access the oracle datbase from your NT machine by using the following command in a dos window "tnsping.exe dndp" or "tnsping80.exe dndp"
Your result should look like this:

TNS Ping Utility for 32-bit Windows: Version - Production on 06-MAR-03

(c) Copyright 1997 Oracle Corporation.  All rights reserved.

Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=server)
OK (10 msec)

if you get this:
TNS-03505: Failed to resolve name

or you can't find the executable, you may need to load the sqlnet / net8 client.


Expert Comment

ID: 8083429
hmmm... wish I would have said that.

Expert Comment

by:Bruce Cadiz
ID: 8083705

Guess It would have helped if I reloaded the page before posting... sorry i014354

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question