Click to See Complete Forum and Search --> : Connect to Oracle from ASP


kennedy
01-15-2006, 07:49 PM
Hi everybody,
My asp application is connect to oracle database.
However, when i try to open the default page, an error occurs and i receive this message:
- Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'MoveFirst'


The code that is causing this error is following:

Dim objConn
Dim rsForums
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=ORCL9; uid=toy; pwd=yes;"
Set rsForums = Server.CreateObject("ADODB.Recordset")
rsForums = objConn.Execute ("SELECT * FROM Forums ORDER BY Forum ASC")
rsForums.MoveFirst
%>
<table width="100%" align="center" cellspacing="0" cellpadding="6" border="1">
<tr>
<td width="60%">
<p><b>Forums</b>
</tr>
<%
While Not rsForums.EOF
%>
<tr>
<td><a href="forum.asp?ForumID=<%= rsForums("ForumID") %>"><B><%= rsForums("Forum") %></B></a>
<BR>
<BLOCKQUOTE>
<%= rsForums ("Description")%><BR>
<SMALL>[Total Posts: <%= rsForums("Posts") %>] [Last Post on <%= rsForums("LastPost") %>]</SMALL>
</BLOCKQUOTE>
</tr>
<%
rsForums.MoveNext
Wend
rsForums.Close


The forums table in the oracle database has 2 lines of records, and it should not occurs this error. Do you have any idea what is happenning?
please, drop me a line.

Best regards,
Kenn

buntine
01-16-2006, 11:48 PM
The MoveFirst function is not required at this point in time. Just remove the line that calls it.

Try something more like this when populating the RecordSet:

Set rsForums = Server.CreateObject("ADODB.Recordset")
rsForums.Open("SELECT * FROM Forums ORDER BY Forum ASC", objConn, 3

Regards.

kennedy
01-17-2006, 04:46 AM
Hi, how are you today?
OK, i'll try your suggestion.
Thanks for your cooperation

Regards,
Kenn

kennedy
01-24-2006, 09:59 AM
Set rsForums = Server.CreateObject("ADODB.Recordset")
Set rsforums = objConn.Execute ("Select * from forums order by forum asc")

This is the correct answer for this problem.
Thank you!
Regards,
Kenn