---从一个表查询若干记录,当记录集不为空时,正常运行,当记录集为空时出错
---也就是出错处理If rs.EOF then 这里怎么写,这个问题比较急,请高手相助,不胜感激Public Function Find(Optional sCatalogID As String = "") As clsCatalogs
Dim strSql As String
    
    strSql = "select * from [Catalog]"
    If sCatalogID = "" Then
        strSql = strSql & " Order By CatalogID"
    Else
        strSql = strSql & " Where CatalogID like '" & sCatalogID & "%'" _
               + " Order by CatalogID"
    End If
    
    Me.Clear
    
    Dim rs As Recordset
    Set rs = g_Con.Execute(strSql)
    
    Dim i As Long
    Dim objCatalog As clsCatalog
    
    While Not rs.EOF
        Set objCatalog = New clsCatalog
        With objCatalog
            .CatalogID = rs("CatalogID").Value
            .SuperID = rs("SuperID").Value
            .CatalogName = rs("CatalogName").Value
        End With
        
        mCol.Add objCatalog               '不能用me.Add objcatalog
        Set objCatalog = Nothing
        rs.MoveNext
    Wend
    
    rs.Close
    Set rs = Nothing
    
    Set Find = Me    
End Function