VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Connect to Lotus Notes View using COM and Loop through records.

by Todd Walling (3 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 5th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Connect to Lotus Notes View using COM and Loop through records.

API Declarations


'===================================================================
' Declare Notes COM variables
'===================================================================
Dim n_Session As New Domino.NotesSession
Dim n_Database As New Domino.NotesDatabase
Dim n_Document As NotesDocument
Dim n_ViewEntry As NotesViewEntry
Dim n_View As NotesView
Dim n_ViewNav As NotesViewNavigator
Dim l_TestVariable As String



Rate Connect to Lotus Notes View using COM and Loop through records.



    ' Initialize session and set database

    n_Session.Initialize
   

    ' Set database

    Set n_Database = n_Session.GetDatabase("Your Server Name", _
                                           "YourFileLocation\YourFile.nsf")
    ' Set to view
    Set n_View = n_Database.GetView("NameOfYourView")
    ' Set view navigator
    Set n_ViewNav = n_View.CreateViewNav
    ' Move to first record
    Set n_ViewEntry = n_ViewNav.GetFirstDocument()
    

    ' Loop through records within view

    Do While Not (n_ViewEntry Is Nothing)
    
        '---------------------------------------------------------------
        ' Set view to document
        '---------------------------------------------------------------
        Set n_Document = n_ViewEntry.Document
        
        '---------------------------------------------------------------
        ' Set local variables
        '---------------------------------------------------------------
        l_TestVariable = n_Document.GetItemValue("TestFieldName")(0)
        
        '---------------------------------------------------------------
        ' Get next entry
        '---------------------------------------------------------------
        Set n_ViewEntry = n_ViewNav.GetNextDocument(n_ViewEntry)
        
    Loop
    

    ' Clean-up

    Set n_ViewEntry = Nothing
    Set n_ViewNav = Nothing
    Set n_View = Nothing
    Set n_Document = Nothing
    Set n_Database = Nothing
    Set n_Session = Nothing


Download this snippet    Add to My Saved Code

Connect to Lotus Notes View using COM and Loop through records. Comments

No comments have been posted about Connect to Lotus Notes View using COM and Loop through records.. Why not be the first to post a comment about Connect to Lotus Notes View using COM and Loop through records..

Post your comment

Subject:
Message:
0/1000 characters