Hi,
I'm trying to connect to oracle from asp pages with IIS using oracle odbc drivers. i managed to connect to it, and i've created a test table, but something is wrong and i need to know why...
<%@ Language=VBScript %>
<html>
<head>
<title>Oracle Test</title>
</head>
<body>
<center>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=OracleDSN;uid=system;pwd=manager;"
Set objRs = objConn.Execute("SELECT * FROM test ORDER BY id ASC")
Response.Write "<table border=1 cellpadding=4>"
Response.Write "<tr>"
For I = 0 To objRS.Fields.Count - 1
Response.Write "<td><b>" & objRS(I).Name & "</b></td>"
Next
Response.Write "</tr>"
'objRS.movefirst
Do While Not objRS.EOF
Response.Write "<tr>"
For I = 0 To objRS.Fields.Count - 1
Response.Write "<td>" & I & " " & objRS(I).Value & "</td>"
Next
Response.Write "</tr>"
objRS.MoveNext
Loop
Response.Write "</table>"
objRs.Close
objConn.Close
%>
</center>
</body>
</html>
up there is the code that i used, and i've created the table using this:
create table test ( id number(8), name char(150) );
if you've noticed this line: 'objRS.movefirst
i hide it cos i can't call that method and i wonder why... i get this error:
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
yeah i have something to clarify here: without that movefirst method, it showed the page without errors but i couldn't see any records at all. I've inserted some records in the database already!
please advice!!