?
Solved

Open External Notes Database

Posted on 2004-10-06
4
Medium Priority
?
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

752 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