Solved

Lotus Notes Question

Posted on 2006-10-27
13
887 Views
Last Modified: 2011-04-14
I have the following code that  populates a list box with the views in a lotus notes database:

  Dim session As Object
    Dim db As Object
    Dim doc As Object
    Dim View As Variant
    Dim field As Variant
   
    Dim DbName As String
    Dim server As String
     
   
    DbName = "Databases/FROPS.NSF"
    server = "NotesSRVHQ2/Midas_International"

    Set session = CreateObject("Notes.NotesSession")
   
    'Open the database
    Set db = session.GETDATABASE(server, DbName)
   
         
        If db.IsOpen = True Then
            For Each View In db.VIEWS
               List1.AddItem View.Name
            Next View
                     
        Else
            MsgBox "Database Not open"
        End If


     
     

      Set db = Nothing
      Set session = Nothing
     


End Sub

my question is...

if i select a view from the list box I would like to display the view data but I'm not sure how to go about creating a recordset to get the data from the lotus notes view.  

Can someone please help?
0
Comment
Question by:johnnyg123
  • 8
  • 5
13 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17820143
Is there a ODBC driver that connects to Lotus Notes?
If so then u make use of that

for example, u can use ADO to open a connection using the DSN u create then create recordsets from this connection



0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17820157
0
 

Author Comment

by:johnnyg123
ID: 17820243
thanks for the post.....

i should have mentioned that for some reason the notes odbc driver will not allow me to view the data.  I think because it is getting confused because there is multiple objects in lotus notes with the same name.

unfortunately, all our lotus notes developers are gone so trying to figure this out has been a bit of a challenge
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 17820260
ok, bear in mind I know jack about Lotus notes having not used or seen it before, and cos of that I cannot even verify my own code here
Im hoping something along these lines would do it for u


Public Sub MyFirstAttemptAtUsingLotusNotesSoBearWithMe()

    Dim adoConn As New ADODB.Connection
    Dim adoRS As ADODB.Recordset
   
   
    On Error Resume Next
   
    adoConn.Open "Driver={Lotus NotesSQL 3.01 (32-bit) ODBC DRIVER (*.nsf)};" & _
                 "Server=myServerName;" & _
                 "Database=mydir\myDbName.nsf;" & _
                 "Uid=myUsername;" & _
                 "Pwd=myPassword"
    If Err.Number <> 0 Then
        MsgBox "Bugger, I cant connect." & vbCrLf & Err.Description
        Set adoConn = Nothing
    End If

    Set adoRS = New ADODB.Recordset
   
    adoRS.ActiveConnection = adoConn
    adoRS.CursorType = adOpenKeyset
    adoRS.LockType = adLockPessimistic
    adoRS.CursorLocation = adUseClient
   
    adoRS.Open "SELECT * FROM MyLotusNotesTable"
    Do While adoRS.EOF = False
        Debug.Print adoRS.Fields(0).name, adoRS.Fields(0).Value
        adoRS.MoveNext
    Loop
    adoRS.Close
    adoConn.Close
    Set adoRS = Nothing
    Set adoConn = Nothing
end sub
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17820312
Have u got the right drivers installed?
0
 

Author Comment

by:johnnyg123
ID: 17820478
I'm getting the dreaded

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


Where is the driver name coming from?


I looked at odbcinst.ini and saw

Lotus NotesSQL Driver (*.nsf) (32 bit)

so I tried it but same thing
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17820497
Well it was just an example, u may need to change to what u have
then specify your database, it looks like it ends with nsf?
and userid/pswd


But It seems u have somethng installed already.
Have u checked the IBM website? its got some sample kit which includes the driver

0
 

Author Comment

by:johnnyg123
ID: 17820661
well....I tried changing the format so it uses dsn instead of driver

guess the odbc gods are smiling


I can't use the latest odbc driver because we have a very old version of the lotus notes clients

The version of the odbc driver that will work apparently doesn't support using an ado connection


I get the dreaded

[Lotus][ODBC Lotus Notes]Driver not capable


I did some searching and it means the odbc driver is too old


ughhhhhhhhhhhh!
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17820826
bugger, sorry. I would of liked to know whether my code worked or not.

I wonder if DAO would work with it

Do u have any documentation to see what is supported?
0
 

Author Comment

by:johnnyg123
ID: 17821389
tried dao as well

still no dice

apparently.....need to use the domino com object model.

The only examples I can find have to do with how to use it involve being able to send an email.

I'm in the same boat as you in that I know diddley about notes.  We haven't been paying for support in years so
no chance of getting IBM to help.
0
 

Author Comment

by:johnnyg123
ID: 17822088
Thanks for the posts rockiroads!


I'm thinking maybe I should post in the Lotus Notes/Domino topic area
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17822363
Hi, just back from the pub :)

Im not familiar with the Domino object model.

If u have problems and get no joy in the other arena, perhaps u may need to hire a consultant for a few days, hopefully get u on track so u can continue. Im afraid Im out of ideas here, sorry pal.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17822364
But I thank you for the pts/grade and wish u the best of luck :)
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question