I'm trying to use the below asp page to connect to my Oracle database and display the records but it is not working, there is no error and no records are displayed, just the table headings. Can anyone tell me why?
The web server I am using is Tomcat 4.1. I have a System DSN setup called "test".
I have Oracle 9.2.0.1.0 Server and Client running on my machine.
Thanks.
[code]
<html>
<body>
This is a view on the database</p>
<%
set con = Server.CreateObject("ADODB.Connection")
con.ConnectionString = "DRIVER={Microsoft ODBC for Oracle};" + _
"SERVER=test;UID=system;PWD=system"
con.Open()
sql = "SELECT * FROM EMPLOYEE"
set CurrentRecordset = con.Execute(sql)
%>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="25%">Name</td>
<td width="25%">Age</td>
<td width="25%">Occupation</td>
</tr>
<%
Do while Not CurrentRecordset.EOF
%>
<tr>
<td width="25%"><% = CurrentRecordset("Name") %></td>
<td width="25%"><% = CurrentRecordset("Age") %></td>
<td width="25%"><% = CurrentRecordset("Occupation") %></td>
</tr>
<%
CurrentRecordset.MoveNext()
Loop
%>
</table>
</body>
</html>
[code]
D:\Projects\intranet>sqlplus system/system@test
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Aug 16 12:31:32 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> SELECT * FROM EMPLOYEE;
NAME AGE OCCUPATION
--------------
Will Williams 25 Electrical engineer
Dave Davidson 34 Museum curator