Opening a document from another database from another database

Tags:
Lotus Domino
Hi, I have a doucment which when composed creates a drop down dynamically taking values from a column in a view from another database. I also have another button next to this field which when clicked should take the value selected from the drop down and search another databse view for a document to match this value and then open it. But it doesnt work .. Sub Click(Source As Button) Dim session As New NotesSession Dim workspace As notesuiworkspace Dim db As NotesDatabase Dim view As NotesView Dim uidoc As notesuidocument Dim doc As NotesDocument Dim product As String Set db = New NotesDatabase( "server", "prductlist.nsf" ) Messagebox db.filename Messagebox db.IsOpen (it returns falsoe here ) Set view = db.GetView( "prodbydesign" ) Messagebox view.Name ( Again error saying that database is not open) Set uidoc = workspace.CurrentDocument product = uidoc.FieldGetText( "odesref" ) Set doc = view.GetDocumentByKey(product) Call workspace.editdocument(False,doc) End Sub I NASICALLY JUST NEED THIS DOCUMENT TO OPEN WHEN USERS NEED TO SEE THE DOCUMENT..I DONT MIND OPENING IT IN EDIT MODE BUT WOULD PREFER TO OPEN IT IN NON-EDIT MODE

Answer Wiki

Thanks. We'll let you know when a new response is added.

It may be a silly question, but is the other database called ‘productlist.nsf’? If this is the case, then you’ve misspelt it in your code – or have you changed the name for the purpose of this post?

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Kmpgmr
    I use a technique in one of my scripts to open the names.nsf database. You'd of course use whatever server name is appropriate. Dim namesDb As NotesDatabase Set session = New NotesSession If session.IsOnServer Then ms = "" Else ms = "Server1" End If Set namesDb = session.GetDatabase(ms,"names.nsf") Otherwise you can try using a database open method once you've identified db. Call db.Open( "", "" )
    290 pointsBadges:
    report
  • Sibkis
    I've often found it works best to open a database in this manner: Set db = New NotesDatabase( "", "" ) Call db.Open( "server", "prductlist.nsf" )
    0 pointsBadges:
    report
  • Rnelson1462
    You have not opened the database is your script. You need to replace "Set db = New NotesDatabase( "server", "prductlist.nsf" )" with "Call db.Open( "server", "prductlist.nsf" )" HTH
    0 pointsBadges:
    report
  • TonyCC
    Guys, In my experience, using the New method of the NotesDatabase object opens it for you. From Help for the New method: Set notesDatabase = New NotesDatabase( server$, dbfile$ ) Parameters server$ String. The name of the server on which the database resides. Use an empty string ("") to indicate a database on the current computer: if the script runs on the workstation, the empty string indicates a local database; if the script runs on a server, it indicates a database on that server. dbfile$ String. The path and file name of the database within the Notes or Domino data directory. Use empty strings for both dbfile$ and server$ if you want to open the database later. Use a full path name if the database is not within the Notes data directory. Return value notesDatabase A NotesDatabase object that can be used to access the database you've specified. If a database exists at the server$ and dbfile$ specified, the NotesDatabase object is open, and the script can access all its properties and methods.
    50 pointsBadges:
    report
  • TonyCC
    Sorry, that last post was a bit negative. The error must be in the line 'Set db = New NotesDatabase( "server", "prductlist.nsf" )' The server name should be in abbreviated form - eg "MyServer/MyOrg" and the filename in your example - "prductlist.nsf" should exist in the Notes data directory of that server.
    50 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following