ImgQueryEnd Example VB

The following example performs a query of documents located on a
1.x Server. The query is based upon keywords assigned to the document.

Private Sub cmdQuery_Click()
    Dim objResults As Object
    Dim varItem As Variant
    Dim intRet As Integer 
    'Perform the query and put results in objResults.
    intRet = ImgAdmin1.ImgQuery("srvrname\test_db:", "finddocs 
        keyword = insurance", objResults) 
    'Write results of the query to a listbox.
    If intRet = 0 Then
        For Each varItem In objResults
            lb_results.AddItem varItem
        Next 
        'Release memory and resources.
        Set objResults = Nothing
        ImgAdmin1.ImgQueryEnd
    End If 
End Sub