Solved

Open External Notes Database

Posted on 2004-10-06
4
182 Views
Last Modified: 2013-12-18
Hi Everyone.

I have this code :

Sub UpdRecs()
      
Dim session1 As New NotesSession
Dim session2 As New NotesSession

Dim db1 As NotesDatabase
Dim db2 As New NotesDatabase("U-APPS/KAIT", "MEMBERS.NSF")
      
On Error Goto ErrorHandler

Set db1 = session1.CurrentDatabase
Set db2 = session2.????????????????      

TheEnd
Exit Function
      
ErrorHandler:
Messagebox Trim$ ( Str( Err ) ) & ":" & Error$, MB_OK, "Invalid Action"
Print Trim$ ( Str( Err ) ) & ":" & Error$
Resume TheEnd
      
End Sub

Now I need to open an external database called MEMBERS.NSF so I could extracts records from it. I've already created a view inside MEMBERS called fmMEM_Mon that have all the information I need to export. What should I put instead of the question marks ? I tried and tried, and everytime I just get more confused. How could I reference an external database and a view inside it within current database ?

Many thanks in advance.

Kindest Regards.
0
Comment
Question by:Faraj1969
  • 2
4 Comments
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
Set db2 = session2.getdatabase(db1.server,"Members.nsf")
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 250 total points
Comment Utility
dim db1 as notesdatabase
dim db2 as notesdatabase
dim view2 as notesview
dim ss as new notessession

set db=ss.currentdatabase
Set db2 = ss.getdatabase(db.server,"Members.nsf") 'Since both are in same server. If it is local then instead of db.server use "".

set view2=db2.getview("yourbviewInExternalDB")


And if ur thinking u want to display a view (which is in another database) in current database , then this cannot be done.

0
 

Author Comment

by:Faraj1969
Comment Utility


I appreciate it madheeswar.

Cheers.

0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Just some info: there is only one NotesSession object in memory, just as there is only one NotesUIWorkspace object. The variables session1 and session2 would "point" to the same object, and reflect the same properties etc.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now