Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totally Weird-Oracle Returns Empty RecordSet!

Status
Not open for further replies.

aitai

MIS
Jul 3, 2001
36
US
Hi, All

I am getting a weird problem accessing data from an Oracle 8.1.7 Database. The SQL query only returns the ColumnHeaders, but no data (no error message either)! Even more weird, the same script (with the obvious modifications) runs perfectly in SQLServer 7.0. I would greatly appreciate any insight that anyone has to offer. Below are the relevent details.

OS: WIN2K
Server: IIS 5.0
Database: Oracle 8.1.7
Table: Desination [DestinationID(CHAR(3)),Country(VARCHAR(20))]
Script: See below

<%@ Language=VBScript %>

<html>
<head>
<title>Oracle Test</title>
</head>
<body>
<center>
<%
Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.Open &quot;dsn=OraDev;uid=scott;pwd=tiger;&quot;

Set objRs = objConn.Execute(&quot;SELECT * FROM Destination&quot;)

Response.Write &quot;<table border=1 cellpadding=4>&quot;
Response.Write &quot;<tr>&quot;

For I = 0 To objRS.Fields.Count - 1
Response.Write &quot;<td><b>&quot; & objRS(I).Name & &quot;</b></td>&quot;
Next

Response.Write &quot;</tr>&quot;

Do While Not objRS.EOF
Response.Write &quot;<tr>&quot;

For I = 0 To objRS.Fields.Count - 1
Response.Write &quot;<td>&quot; & objRS(I) & &quot;</td>&quot;
Next

Response.Write &quot;</tr>&quot;

objRS.MoveNext
Loop

Response.Write &quot;</table>&quot;

objRs.Close
objConn.Close
%>
</center>
</body>
</html>



 
Try making all this:

Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.Open &quot;dsn=OraDev;uid=scott;pwd=tiger;&quot;

Set objRs = objConn.Execute(&quot;SELECT * FROM Destination&quot;)


into

Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.Open &quot;dsn=OraDev;uid=scott;pwd=tiger;&quot;
dim sql
sql = &quot;SELECT * FROM Destination&quot;
Set objRs = server.createObject(&quot;ADODB.Recordset&quot;)
objRs.open sql,objCon

Might put it over the hump because you aren't asking for anything implicitly.

hope that helps! :)
Paul Prewett
penny.gif
penny.gif
 
your code looks fine - you sure you have stuff in your destination table?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top