Connecting to Notes Databases from VB App - Code Error

Hello,

I’m trying to make a vb app which needs to pull data from a notes view first of all. I have succeeded in doing this with excel before and have adapted the code a little to try and get it working in my VB app:

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim db As Object

    Dim NotesSession As Object

    Dim view As Object

    Dim pipeDoc As Object

    Dim entry As Object

    NotesSession = CreateObject("Lotus.NotesSession")

    Call NotesSession.Initialize()

    Db = NotesSession.GetDatabase("removed", "removed", False)

    If Not Db Is Nothing Then

        Dim pipeNo As String

        Dim row As Integer

        row = 4

        view = Db.getview("removed")

        If view Is Nothing Then

            MsgBox("View is nothing...")

        End If

        pipeNo = "E118733"

        While Not (pipeNo = "")

            entry = view.getEntryByKey(pipeNo, True)

            If Not (entry Is Nothing) Then

                pipeDoc = entry.document

                Test.Text = pipeDoc.getItemValue("AnticoDecision")(0)

            End If

        End While

    Else

        MsgBox("Failed to get handle")

    End If

    MsgBox("Done")

End Sub

End Class

I’m gettign on error here:

NotesSession = CreateObject(“Lotus.NotesSession”)

Stating that it connot create the active X component… any ideas? Shouldn’t I needed a notes dll to enable the connection?

Thanks,

Richard

Subject: VB

Hi,I have taken this code from designer help:Dim s As NotesSession

Set s = CreateObject(“Lotus.NotesSession”)

Call s.Initialize

you find a lot more under that. Hope this helps.

oh - don’t forget to select the references to the notes objects and also automation…

Subject: re:

Is the Notes client installed on the workstation? If yes, you can try to put the Lotus directory into the %PATH% environment variable for the system to find the nnotes.dll…

Subject: Have you registered the notes com interface?

regsvr32 nlsxbe.dll

Subject: Same Here!

This was a problem back in 8.0, but was fixed with hotfix 1.

It appears that the bug has crept back in!

I have code that runs fine under Windows XP 32 bit, but crashes when run under Windows 7 64 bit.

I had hoped that 8.5.1 FP 1 would fix this since the release notes say that Win7 64 bit is now supported, but alas! it does not help.