Hi There,

Is it possible to return a recordset from a function? what I am trying to do
is something like this

ex.

Function test(SQLCommand)
...
Set test = objADODBConnection.Execute(SQLCommand)

End Function

...

Set objRecords = test(SQL)
msgbox(objRecords("ID"))

thanks,
James

Re: return recordset from function by Bob

Bob
Fri Apr 08 10:32:15 CDT 2005

James Robertson wrote:
> Hi There,
>
> Is it possible to return a recordset from a function? what I am
> trying to do is something like this
>
> ex.
>
> Function test(SQLCommand)
> ...
> Set test = objADODBConnection.Execute(SQLCommand)
>
> End Function
>
> ...
>
> Set objRecords = test(SQL)

Never try and access a recordset's data without first checking its EOF
property to make sure it contains data.

> msgbox(objRecords("ID"))
>
> thanks,
> James

Sure, it is! What happens when you try it?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: return recordset from function by James

James
Sun Apr 10 10:13:54 CDT 2005

I think my problem is due to a recursive call...

James