Cannot access database, then can anyway

I have a simple database to store reports.  It's set up with a frameset, left frame is an outline, right frame is the target for items chosen on the right.  Each outline item has a hide when like:
@IsNotMember("[AgentLicMonth]" : "[Admin]" : "[All Reports]" ;@UserRoles)
such that a person has to have one of those roles to get in.

When I email a doclink to a user who has one of the roles, he gets an error that he cannot access the database; however, when he clicks OK to that message, he gets in and can view what he is supposed to.

Default access is reader.  There is no other security (reader or author fields) on the database.  Document and view access is reader and above.

What I want is for the error not to happen, and the user with that role to get in without problems.


Who is Participating?
You're hide-when syntax is correct and would not give an access error in any case.  Keep looking for code that executes behind the scenes.  In particular, look for two saves in the hit-counter code.  Author access would allow one save to a new document, but normally not two.  Also, depending on how the hit counter is designed, the code may try to update a profile document to which the user does not have access.  If either of these are the cause, increasing the access in the hit counter database to Editor should solve the problem.
(1) Does this happen to other users?
(2) Did you create the link from a local replica rather than from the server?
(3) Is there any Database, View or Form code (QueryOpen, PostOpen, etc) that references other databases?
(4) Have you had any problems sending links to other users that do not have a role enabled (ie: what makes you think it has something to do with the user's role)?
jkee54Author Commented:
Getting there!
(3) This was it - there is post open code in all the forms that reference another database to be able to count when the documents are opened.  It was set to No Access default - I upped it to Author to allow that record to be created.  

However, they still can't get in.  Now the error is, "you are not authorized to perform that operation", and the db does not open at all.

In my hide when, if I want users with any of those roles to get in, is the right operand : or should it be | ?
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Check the hit counter's ACL and see how most users are authenticated.  Is it possible that this one user is not listed in the correct groups?
jkee54Author Commented:
Upping to Editor does it.   The hit counter database is internal to my team and the users receiving the error did not have any access before - in fact, my last question would be, is this all background coding, i.e. if the users don't have the counter database on their desktops, they won't get it, right?
They will get an error if the code cannot find the database.

If you want to ensure that all hits are recorded, then you need to deploy the hit counter db to the user's local machine.

If you don't care about local hits, then add an error trap to the code that opens the database.  There are several ways to do this.

(1) NotesDatabase.Open returns a flag indicating whether the database opened.
(2) You can check NotesDatabase.IsOpen.
(3) You can add a true error trap like this.

On Error goto CATCH
set db = db.Open("", "")
' Do something with database here.
call db.Close()
Exit Sub

Print "Unable to open hit counter"
Exit sub

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.