Re: Returning recordset from a function and using EOF

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



eof is a propert of the RS.

example....

Do While Not RS.EOF
'display record data
RS.MoveNext
Loop



<sherri.wheeler@xxxxxxxxx> wrote in message
news:1163093864.919528.249950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I have been all over the web looking for a definitive answer to this
question. I want to have a function which grabs a record set, and
returns it. Then, after my function call, I want to use something like
EOF or GetRows() to cycle through the record set. But no matter what I
try, I get the following error:

Object doesn't support this property or method: 'currentRow.EOF'

-----------------

Code returning set from function:

<snip>
rs.Open cmd, , adOpenStatic, adLockReadOnly
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
set rs.ActiveConnection = Nothing
oConn.Close
Set oConn = Nothing
getReportLogRow = rs ' This is the return statement
End Function

----------

Code using the returned recordset:

<snip>

Set currentRow = CreateObject("ADODB.Recordset")
Set currentRow = getReportLogRow(sessID)
if(currentRow.EOF)then

<snip>
---------------------

If I can solve this... I'm gonna publish the solution all over the
place because I can't be the only one ripping out their hair over this.
Why does vbscript-asp make using functions such a pain? ;)

Thanks for any help!



.



Relevant Pages