Cannot Open some databases

I’m using a LotusScript agent and opening Notes Databases via the backend so I can get their Title and repID.

My code looks like this:

Dim session As New NotesSession

Dim db As NotesDatabase, newDb As NotesDatabase

Set db = session.CurrentDatabase

Set newDb = New NotesDatabase( db.Server, “pp66temp.nsf” )

Set newDb = New NotesDatabase( db.Server, “pp65temp.nsf” )

For some reason, even though the ACL, and everything else I can see are identical, other than the name, the 66 db won’t open, while the 65 one will. I have a lot of dbs that this is occuring on. I even call a newDb.Open( “”, “” ) and that doesn’t help either.

Also, all the dbs in the root data directory will open, but few in sub folders will open. I’m sure I’m missing something. Any thoughts?

Thank you for your advise and help.

Tim Williams

Subject: Cannot Open some databases

I just answered this question for someone else here. Please search before posting. Thanks.

If that doesn’t help, please note that you haven’t actually given us an example of a situation that fails. If you still don’t see the solution after reading what I posted earlier, we need more information about what you’re doing. If you’re not sure what information to supply, the C R I S P Y document might help you. In addition to those general guidelines, please be sure to include an exact example of an open attempt that fails, including the actual code, the actual database name, the actual values of the variables, and a description of what happens when you try to open the same database manually, using the exact and actual values copied and pasted from your variables in your debugger output.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

Subject: Thanks…But…And Code Too

Thanks for the advise about searching before posting. Already done that. Didn’t find anything. If you are referencing your posts:

October 13, 2006 – http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/a49c782a51b36407852572060060be65?OpenDocument

February 3, 2006 – http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/a4f2cbad0622fff28525710a004e0606?OpenDocument

Neither one helps me. As for code, my actual effort was much more complex, but I simplified it into an agent I could run from the agent list with the debugger on to test and it did the exact same thing. The code is:

Dim session As New NotesSession

Dim db As NotesDatabase, newDb As NotesDatabase

Set db = session.CurrentDatabase

Set newDb = New NotesDatabase( db.Server, “pp66temp.nsf” )

'This db shows as found but it not open (open is false)

If Not(newDb.isopen) Then

Call newDb.Open( "", "" )

End If

'Still not opened. (open is false)

Set newDb = New NotesDatabase( db.Server, “pp65temp.nsf” )

'This db is open. Both are virtually identical except for some

'different documents. Many dbs are not opening. My id and

'server are explicitly declared managers in the ACL of all dbs.

Any thoughts? Thank you for your help.

Tim Williams

Subject: RE: Thanks…But…And Code Too

No, actually I was referring to this thread.

You appear to be contradicting yourself. You tell us that you can open “pp65temp.nsf” but not “pp66temp.nsf”, but in your other message you say “all the dbs in the root data directory will open”. But “pp66temp.nsf” is in the root data directory, and yet you are now saying it does not open.

We are still missing a description of what happens when you try to open the same database manually, using the exact value that’s in db.Server and the exact filepath “pp66temp.nsf”. We are still missing the exact values of your variables, specifically db.Server.

Test your inputs.

Test your inputs.

Test your inputs.

My suspicion is that db.Server is other than you thought it would be. E.g. possibly you are running in a local replica and didn’t realize it (db.Server = “”), so you can only find the databases of which you also have a local replica with the same filepath as on the server.