Solved

Open External Notes Database

Posted on 2004-10-06
4
183 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
ID: 12235188
Set db2 = session2.getdatabase(db1.server,"Members.nsf")
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 250 total points
ID: 12235203
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
ID: 12235300


I appreciate it madheeswar.

Cheers.

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12235490
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 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

21 Experts available now in Live!

Get 1:1 Help Now