Manage Learn to apply best practices and optimize your operations.

Notes2Access With Dao

Sub Click(Source As Button)
'On Error Resume Next
Dim dbE As Variant
Dim ws As Variant
Dim Accessdb As Variant
Dim rs As Variant
Dim fl As Variant

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item As NotesItem

Set db = session.CurrentDatabase
Set view = db.GetView("($Import)")
' You may have to substitute "DAO.DBEngine.35" with "DAO.DBEngine" depending on
your version of DAO
Set dbE = CreateObject( "DAO.DBEngine.35" )
Set ws = dbE.CreateWorkspace( "", "admin", "", 2 )

' Open database - replace MW.MDB with your database name
Set Accessdb = ws.OpenDatabase( "D:\MW.MDB" )

' Open recordset - replace Verbindungsdaten with your table name
Set rs = Accessdb.OpenRecordset("Verbindungsdaten")

Set doc = view.GetFirstDocument

While Not (doc Is Nothing)

' Add a new recordset


'Syntax : rs.Fields("FieldInAccessTable").Value = "FieldInNotesDoc"
rs.Fields( "Name" ).Value = ItemTextReturn(doc,"User")
rs.Fields( "Gruppe" ).Value = ItemTextReturn(doc,"Gruppe")
rs.Fields( "DatumBeginn" ).Value =
rs.Fields( "DatumEnde" ).Value = ItemTextReturn(doc,"VerbindungEnde")
rs.Fields( "ZeitBeginn" ).Value =
rs.Fields( "ZeitEnde" ).Value =
rs.Fields( "Dauer" ).Value =
rs.Fields( "KST" ).Value = ItemTextReturn(doc,"KST")


Set doc = view.GetNextDocument(doc)


Call rs.Close
Call Accessdb.Close
Call ws.Close

End Sub

Function ItemTextReturn(doc As NotesDocument, itemName As String) As String

' Check whether the specified document has the specified item
' and whether there is an actual value... Returns "" if the
' item does not exist, or if it does exist and it's text value is
' null (""). Returns the value if it does exist. Accessing the
' text property of an item is a quick and dirty way to get an
' item's value as a string.

On Error Goto ErrorHandler

ItemTextReturn = ""
Dim tempString As String

If (doc Is Nothing Or Strcomp(itemName, "") = 0) Then Goto TheEnd

If doc.HasItem(itemName) Then
ItemTextReturn = Trim$(doc.GetFirstItem(itemName).Text)
End If

Exit Function

ItemTextReturn = ""
Resume TheEnd

End Function

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...