Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 789
  • Last Modified:

ASP - Show oracle table with ODBC

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
  • 3
  • 2
1 Solution
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.
Bruce CadizQuality SpecialistCommented:
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
Bruce CadizQuality SpecialistCommented:
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.

hmmm... wish I would have said that.
Bruce CadizQuality SpecialistCommented:

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now