Cannot access database, then can anyway

Posted on 2007-10-04
Last Modified: 2013-12-18
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.


Question by:jkee54
    LVL 22

    Expert Comment

    (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)?

    Author Comment

    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 | ?
    LVL 22

    Accepted Solution

    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.
    LVL 22

    Expert Comment

    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?

    Author Comment

    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?
    LVL 22

    Expert Comment

    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


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

      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…
    Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    746 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

    15 Experts available now in Live!

    Get 1:1 Help Now