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

x
  • 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.
*************************CODE*****************************
<%
 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
%>

***********************ERROR*****************************
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
0
Wizmasterus
Asked:
Wizmasterus
  • 3
  • 2
1 Solution
 
i014354Commented:
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.
0
 
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
    rs.movefirst
    response.write "USER IS:" & rs.fields("USER").value
    rs.close
Set rs = nothing
%>
0
 
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 8.0.6.0.0 - Production on 06-MAR-03
 12:01:48

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

Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=server)
(PORT=1521))
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.


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

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

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