This is my vb6 programme for creating recordset in a module. and call it in class
and form
module :ModMain
Public Function getRec(strQry As String) As ADODB.Recordset
Dim r As New ADODB.Recordset
On Error Resume Next
If r.State = adStateOpen Then r.Close
r.CursorLocation = adUseClient
r.Open strQry, Con, adOpenStatic, adLockReadOnly, adCmdText
Set getRec = r
End Function
class:clsOrganization
Public Function fillOrgName() As ADODB.Recordset
strQry = "select NAME,CODE FROM ORGANIZATION ORDER BY NAME"
Set fillOrgName = getRec(strQry)
End Function
is there any way to create dataset in a module and call it in a class????

