Results 1 to 15 of 15
  1. #1
    Join Date
    May 2004
    Posts
    90

    Question Unanswered: User-level security question

    Hi,
    I am having some issues while setting up the user level security in access 2000. I have ran the user level security wizard and it worked great but on all my forms and reports where I use a module object it says "invalid username or password" and I click end and it opens the form. But it works fine on all the other forms and reports that don't use any module objects.

    I know that there is a way to write some VB code to connect to the database but everything I saw you must put a DB path and password which is not going to be possible in my case because the database uses the module in many places and the database is going to be deployed to many different computer systems with different paths and passwords thus it is not feasable to change the code at every install. What can I do?

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Check the permissions on your module(s) and make sure your users and/or groups can open and run them.

  3. #3
    Join Date
    May 2004
    Posts
    90
    Alright,
    How would I do that? When I go into User and Group permissions there is no way to change the permisions on modules. You can change permissions on everything except for the modules. I am running access 2000 if that is of any help. Thanks - Lenni

  4. #4
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Could you explain exactly when you receice the error "invalid username or password"?
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  5. #5
    Join Date
    May 2004
    Posts
    90
    Sure,
    I open the database and a user name and password box pops up. If I type in an invalid username or password here it tells me it is invalid and this is not the problem. If I log on as an Admin then everything works fine. But when I log on as any other group (Read Only, Full User, etc...) the database opens fine with no errors but as soon as I open a form that uses a module the following error pops up:

    run-time error '-2147217843 (80040e4d)':
    Not a valid account name or password

    With 2 options End or Debug. If I click end the form opens but the module does not run (I know because in one case the module object adds some text to the form).

    There is no errors however when I open a form that does not use a module object.

    Thanks

  6. #6
    Join Date
    May 2004
    Posts
    90
    Is there possibly something I can include in my module code? Or how can I get this to work? I have been working at this for a while and cannot seem to figure out what is wrong. I have tried all the permission setting but nothing seems to be working.... Any help would be appreciated.

  7. #7
    Join Date
    May 2004
    Posts
    90
    http://www.mvps.org/access/modules/mdl0036.htm

    There is some information there but I don't know exactly what they mean or how to do what they are saying so maybe someone can tell me if this is something that will work.

  8. #8
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Please post the code behind the offending form and indicate where access points you if you hit debug. You might be trying to do something through code that the user doesn't have rights to do.

  9. #9
    Join Date
    May 2004
    Posts
    90
    Here is the code that I am using where it goes to if I debug:

    Dim mobjOptions As Object
    Set mobjOptions = New Options
    With mobjOptions
    .GetOptions
    Me.lblTitle.Caption = .OrgAcronym & Me.lblTitle.Caption
    End With

  10. #10
    Join Date
    May 2004
    Posts
    90
    Here is my initialization method of my module, maybe I made a mistake there:


    Private Sub Class_Initialize()

    Set mconn = New ADODB.Connection
    Set mrst = New ADODB.Recordset

    FixUpRefs
    mconn.ConnectionString = CurrentProject.Connection
    Debug.Print CurrentProject.Connection
    mconn.Open

    mrst.LockType = adLockOptimistic
    mrst.CursorType = adOpenDynamic
    mrst.Open "CustomOptions", mconn, Options:=adCmdTable
    Call GetOptions

    End Sub

  11. #11
    Join Date
    May 2004
    Posts
    90
    has no one else had any problems similar to this?

  12. #12
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Do the other groups have design change rights on the form?

    I think you may need them to change the label
    Me.lblTitle.Caption = .OrgAcronym & Me.lblTitle.Caption

    Try commenting out that line and see if it runs.

  13. #13
    Join Date
    May 2004
    Posts
    90
    Thanks for the input. I tried to change all the privliges like you said for a user account to the exact same as the admin account but with no luck, I still get the error. I tried commenting out the line like you siad but it did not help. I also have tried to change the owner for the forms,reports,tables from admin to even just the User account but with no luck. Anyone else have any more ideas? This is really frustrating.

  14. #14
    Join Date
    May 2004
    Posts
    90
    I have found out that this line does executes with no problems
    Dim mobjOptions As Object

    but when this line executes is when the error starts happening
    Set mobjOptions = New Options

    So this makes me think that there is a problem with the initialization method in the module which I have posted above already. Does anyone see a problem with the method, I can't see to find any problems? (It is posted a few posts back).

  15. #15
    Join Date
    May 2004
    Posts
    90
    Okay, well back to the start. I think I just need to connect up to the database using Visual Basic code. Can anyone tell me the code to connect to a username/password secured database like the one that has been discussed here?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •