Lotus Notes SQL ODBC interface from Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Alston

    Lotus Notes SQL ODBC interface from Access

    I am trying to access data in a Lotus Notes database, from Access.
    The Notes database is release R5.
    I installed NotesSQL 8.x and have it working. However it chokes on
    one of the tables and references problems with the dates.
    If I create a query, without these dozen or so dates, I can access all
    the data.

    However I am guessing that most of the dates are correct and only some
    are bad.

    Anyone encounter this before and hopefully have a solution?

    bob
  • Rich P

    #2
    Re: Lotus Notes SQL ODBC interface from Access

    Greetings,

    I would go with the Lotus Script instead of the ODBC driver. Here is
    some sample code - this will use Lotus Script which you can add DAO code
    to read the data from the Lotus Script - make a reference to the Notes
    Library in Tools/References - also - you can use early binding with R5
    dim sess as New Notes.Session - way better than late binding):

    Dim session As Object 'notes session
    Dim db As Object 'notes database
    Dim view As Object 'notes view
    Dim searchview As Object 'notes search results
    Dim doc As Object 'notes document
    Dim DocCount As Long
    Dim ViewStr As String
    Dim testvar As string
    ViewStr = "3. R&D\By Period"

    Set session = CreateObject("N otes.NotesSessi on")
    Set db = session.GETDATA BASE("SERVERNAM E",
    "C:\someDir\you rNotesNsf.nsf")
    Set view = db.GetView("Vie w1")
    Set doc = view.getfirstdo cument
    testvar = doc.getitemvalu e("fld1")

    then you can loop using the GetNextDocument object

    Rich

    *** Sent via Developersdex http://www.developersdex.com ***

    Comment

    • Bob Alston

      #3
      Re: Lotus Notes SQL ODBC interface from Access

      Rich P wrote:
      Greetings,
      >
      I would go with the Lotus Script instead of the ODBC driver. Here is
      some sample code - this will use Lotus Script which you can add DAO code
      to read the data from the Lotus Script - make a reference to the Notes
      Library in Tools/References - also - you can use early binding with R5
      dim sess as New Notes.Session - way better than late binding):
      >
      Dim session As Object 'notes session
      Dim db As Object 'notes database
      Dim view As Object 'notes view
      Dim searchview As Object 'notes search results
      Dim doc As Object 'notes document
      Dim DocCount As Long
      Dim ViewStr As String
      Dim testvar As string
      ViewStr = "3. R&D\By Period"
      >
      Set session = CreateObject("N otes.NotesSessi on")
      Set db = session.GETDATA BASE("SERVERNAM E",
      "C:\someDir\you rNotesNsf.nsf")
      Set view = db.GetView("Vie w1")
      Set doc = view.getfirstdo cument
      testvar = doc.getitemvalu e("fld1")
      >
      then you can loop using the GetNextDocument object
      >
      Rich
      >
      *** Sent via Developersdex http://www.developersdex.com ***
      Thanks very much. I will give it a shot.

      bob

      Comment

      • BobA

        #4
        Re: Lotus Notes SQL ODBC interface from Access

        On Oct 16, 6:53 pm, Bob Alston <bobalst...@yah oo.comwrote:
        Rich P wrote:
        Greetings,
        >
        I would go with the Lotus Script instead of the ODBC driver.  Here is
        some sample code - this will use Lotus Script which you can add DAO code
        to read the data from the Lotus Script - make a reference to the Notes
        Library in Tools/References - also - you can use early binding with R5
        dim sess as New Notes.Session - way better than late binding):
        >
        Dim session As Object   'notes session
        Dim db As Object        'notes database
        Dim view As Object      'notes view
        Dim searchview As Object 'notes search results
        Dim doc As Object       'notes document
        Dim DocCount As Long
        Dim ViewStr As String
        Dim testvar As string
        ViewStr = "3. R&D\By Period"
        >
        Set session = CreateObject("N otes.NotesSessi on")
        Set db = session.GETDATA BASE("SERVERNAM E",
        "C:\someDir\you rNotesNsf.nsf")
        Set view = db.GetView("Vie w1")
        Set doc = view.getfirstdo cument
        testvar = doc.getitemvalu e("fld1")
        >
        then you can loop using the GetNextDocument object
        >
        Rich
        >
        *** Sent via Developersdexht tp://www.developersd ex.com***
        >
        Thanks very much.  I will give it a shot.
        >
        bob- Hide quoted text -
        >
        - Show quoted text -
        One question: I do not know where the nsf database is physically. To
        use this approach it looks like I need to know the file address of the
        nsf - correct?
        I have the Notes client and can access the database. Any easy to
        identify the database file name (without having to go to the system
        administrator?) ?

        thanks

        Comment

        • Rich P

          #5
          Re: Lotus Notes SQL ODBC interface from Access

          Straight from memory here (haven't worked with Lotus Notes going on 4
          years now) You can right click on a database icon in the Notes client
          window - go to properties and somewhere there it should show the path to
          the .nsf file. Here is a caveat - if you don't have the proper rights
          to that .nsf I don't think you will be able to see the path or
          read/write data - maybe read. I forget Notes security -they have
          readers/read-write/administrator/and a few other levels. once you have
          the path you should be able to read programmaticall y.

          Rich

          *** Sent via Developersdex http://www.developersdex.com ***

          Comment

          Working...