Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return a Recordset from the called Function

Status
Not open for further replies.

trezlub

Programmer
May 2, 2003
67
GB
If I run some SQL to generate a recordset within a called function, how can I return the recordset back to the calling function/procedure?

Example:
--------------------------------------

<%
Dim recordset
GetRecordset recordset 'calling procedure

'would like to be able to manipulate &quot;recordset&quot; here
%>

<%
Private Function GetRecordset()

'Called Function
'...something to create a recordset

End Function
%>
 
<%
myRs = GetRecordset('youcould have prams here')
%>

<%
Private Function GetRecordset('youcould have prams here')
set rs = db.execute(&quot;select * from pt&quot;)
GetRecordset = rs
End Function
%>
 
The easy way would be for the recordset object to be created outside of the function but of course be used inside...

Best regards,
J. Paul Schmidt - Freelance ASP Web Developer
- Creating &quot;dynamic&quot; Web pages that read and write from databases...
 
Cheers mumbojumbo and Bullschimdt, both ideas are very good and helpful. The problem I had has now been solved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top