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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you return recordsets in functions

Status
Not open for further replies.

TLiberty

Programmer
Nov 22, 1999
27
US
I am new to VB 6.0 and is there anyway you can return a recordset from a function.<br>
<br>
i.e.<br>
Set rs = SomeFunction(SQL,options)<br>

 
Sure can,<br>
<br>
Set rs = GetRecordSet(strSQL)<br>
<br>
Then the function looks like this:<br>
<br>
Public Function GetRecordSet(strSQL as String) As RecordSet<br>
Dim NewRS as Recordset<br>
<br>
Set GetRecordSet = NewRS<br>
Exit Function<br>
<br>
Steve<br>
<A HREF="mailto:sdmeier@jcn1.com">sdmeier@jcn1.com</A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top