Function GetADNList(ByVal strSql As String) As ??
Dim myADNList As DataList
Dim myNode As Node
Set myADNList = New DataList
With cmd
.CommandText = strSql
.CommandType = adCmdText
End With
cmd.Execute
rs.Open cmd, , adOpenStatic, adLockOptimistic
While Not rs.EOF
Set myNode = New Node
With myNode
.ADN_ID = rs("adn_index")
.ADN_NAME = rs("user_name")
.ADN_PHONEBOOK = rs("phonebook_index")
.ADN_GROUPS = rs("group_index")
End With
myADNList.AddNode myNode
rs.MoveNext
Wendrs.Close 'GetADNList = myADNList
End Function
问题1:怎样才能把MYADNLIST作为函数的结果传出去
问题2:GetADNList的返回类型是什么,让我返回自定义的类请大虾们帮忙看看,非常感谢!
Dim myADNList As DataList
Dim myNode As Node
Set myADNList = New DataList
With cmd
.CommandText = strSql
.CommandType = adCmdText
End With
cmd.Execute
rs.Open cmd, , adOpenStatic, adLockOptimistic
While Not rs.EOF
Set myNode = New Node
With myNode
.ADN_ID = rs("adn_index")
.ADN_NAME = rs("user_name")
.ADN_PHONEBOOK = rs("phonebook_index")
.ADN_GROUPS = rs("group_index")
End With
myADNList.AddNode myNode
rs.MoveNext
Wendrs.Close 'GetADNList = myADNList
End Function
问题1:怎样才能把MYADNLIST作为函数的结果传出去
问题2:GetADNList的返回类型是什么,让我返回自定义的类请大虾们帮忙看看,非常感谢!
.................
set GetADNList=myADNList
End Function
public type DataList
Dim myADNList As DataList
Dim myNode As Node
Set myADNList = New DataList
With cmd
.CommandText = strSql
.CommandType = adCmdText
End With
cmd.Execute
rs.Open cmd, , adOpenStatic, adLockOptimistic
While Not rs.EOF
Set myNode = New Node
With myNode
.ADN_ID = rs("adn_index")
.ADN_NAME = rs("user_name")
.ADN_PHONEBOOK = rs("phonebook_index")
.ADN_GROUPS = rs("group_index")
End With
myADNList.AddNode myNode
rs.MoveNext
Wendrs.Closeset GetADNList = myADNList
End Function
Private object modules cannot be used in public object modules as parameters or return types for public procedures,as public data members,or as fields of public user defined types