Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Security (Access 2000)

    Hello,

    I created an Access 2000 database for someone and when they go from 'design' mode to 'view' mode they get the following error:

    Run-time error '-2147467259 (80004005)' The database has been placed in a state by user 'Admin' on machine 'WEIGET1' that prevents it from being opened or locked.

    'WEIGET1' is her machine and she is the only one with the database open. I am wondering if there are any security settings that I am missing that would cause her to get this message. I don't know what I need to do so she doesn't get the error. I'd like her to be able to go back and forth into design and view mode without problems. What am I doing wrong?

    Any help would be very appreciated.

    Regards,

    Amanda

  2. #2
    Star Lounger
    Join Date
    Dec 2000
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    What OS are you using? Windows 2000? This sounds more like a Windows 2000 permissions problem than an Access security issue.

    But first, you need to rule out that it's not the Access security which is causing the problem. (I assume you didn't create Access login security for this user. If so, none of the following applies.) In Access, go to User and Group Permissions under the Tools | Security menu. You should see only one user: Admin. Make sure that user has full rights for ALL the objects -- the Database itself, Tables, Queries, Forms, Reports, etc.

    If you find that the Admin user indeed has full rights, then like I said, your problem is most likely due to Windows 2000 (or whatever OS you're using) permissions. In the directory where this DB is stored, make sure this user has full rights to the directory itself and this particular database file. You'll have to log into Windows 2000 (or whatever OS you're using) as an administrator in order to do this. I don't remember all the particulars of setting permissions in Windows 2000, so you should consult your Windows documentation before doing this. Just remember, give this user full rights for that directory and the file itself.

    Stephan

  3. #3
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Thanks for the help, but, *sigh* unfortunately it didn't solve the problem. *pout* I went ahead and checked all permissions and they were set correctly - to have full access. When I get the runtime error indicating that "The database has been placed in a state by user 'Admin' on machine 'WEIGET1' that prevents it from being opened or locked." it is a "debug" message - meaning I can go in and debug the error. It takes me into VB code that I wrote that connects to the database. The following is the code:

    Set Conn = New ADODB.Connection
    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:My DocumentsdatabasesProductReleaseControl.mdb;"

    and I am getting the error when I execute the Conn.Open statement - but only when I switch from design mode into view mode. Strange. Anyway, I am guessing that what is happening is that the connection is being created in view mode and then after switching into design mode and then back into view mode the connection is tried again and that is where it is locking up. So, perhaps my question is - How can I create a connection to the database in my VB code that will not cause this error when a user tries to go to and from design mode. Perhaps the connection string that I am using is not the right kind?

    As always, any help is greatly apprecitaed.

    Regards,

    Amanda

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Seems like you have set a password for the Admin User.
    A database password is set in Tools | Security | Set Database Password. This will be only for this database.
    If you have use Tools | Security | User And Groups Accounts and changed the password in the Change Logon Password, you change the password for the user Admin for all databases.
    Francois

  5. #5
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Just tried setting a password for Admin User and no luck. I still get the error. I've been looking at it all morning again and I think what is happening is when a form is in design mode, the database gets locked so design changes can be made. Then, when the form gets switched back to view mode and the connection string code tries to execute, the lock created while in design mode still exists and the code trying to open the connection fails. So, before I execute the Open command, maybe I need to "close" or "unlock" the database connection that was created while in design mode? I am not sure if that makes any sense, but I am thinking that the problem is not security (like I once thought), but rather a connection problem. Only, I know my ADODB connection "syntax" is fine, it's just that it errors when I go from design mode to view mode.

    Anyone have any suggestions?

    Regards,

    Amanda

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access Security (Access 2000)

    Hi Amanda,
    How is this code being triggered? I assume it's event driven, but which event? Also, can you post the whole of the code?
    Incidentally, I think Francois response was actually in relation to another post regarding password protection (but I could be wrong!)
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Sory Amanda,
    Rory is right.
    This was for post 129787 from SOS Typing.
    Francois

  8. #8
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Rory,

    Thanks for your reply. The code (the connection string) is inside of a Function that the form calls when it loads. Here is the function...

    Function GetDBConnection()

    'Open the Connection Object
    Set Conn = New ADODB.Connection
    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:My DocumentsdatabasesCurrentCopy(Tonya)ProductRelease Control.mdb;"

    GetDBConnection = Conn

    End Function



    And here is the VB for the form that calls the function:

    Private Sub Form_Current()

    DoCmd.Maximize

    'Open the Connection Object
    Call GetDBConnection

    End Sub



    So, when the "form_current" executes, it calls the function which creates the connection string. The form then uses the Conn object for various tasks. But, I think the database is still locked from the form previously being in design mode and that is why opening the connection is failing. Anyway, as always, any ideas or suggestions are appreciated.

    Regards,

    Amanda

  9. #9
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access Security (Access 2000)

    Hi Amanda,
    A couple of things:
    1. I assume Conn is declared outside the procedure?
    2. Is there a reason you're using the form's Current event rather than the open or load event? It will fire every time you change record as it stands.
    3. You're assigning Conn to GetDBConnection but you're not actually using GetDBConnection to return an object. I'd suggest commenting out or removing the GetDBConnection = Conn line.
    Any of that help?
    Regards,
    Rory

    Microsoft MVP - Excel

  10. #10
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Rory,

    1. Yes, Conn is declared outside the procedure and is Global
    2. I am not sure why I am putting the function call in Current instead of Open or Load....?? Must have been developing and put it there by mistake. Good catch!
    3. I commented out he GetDBConnection = Conn line (good catch again!) but am still stuck with the same problem. I am still getting the runtime error when I switch from design mode to view mode.

    Is there a setting in Access that I may be missing that would not lock the database when a form (or other object) is in design mode? I still think that the database is getting locked while it is in design mode and then when I flip back to view mode and the VB ADODB connection string tries to execute it fails because the database is still locked from it previously being in design mode.

    Any ideas?

    Regards,

    Amanda

  11. #11
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access Security (Access 2000)

    Have you closed and reopened the database since changing the code (just to make sure everything has reset itself)? I will have another think in the meantime!
    Regards,
    Rory

    Microsoft MVP - Excel

  12. #12
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Yup, closed and re-opened the DB a couple of times just to be sure. [img]/forums/images/smilies/smile.gif[/img]

    Thanks for you help. I really do appreciate it.

    Regards,

    Amanda

  13. #13
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    It's just a thought but one other thing to try is a compact and repair. I have seen some pretty strange occurrences that this procedure has fixed. You can locate this under Tools, Database Utilities, Compact and Repair.

    Thanks,
    Mark

  14. #14
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Security (Access 2000)

    Yup, tried compacting and repairing too. No luck. *sigh* I'm about ready to go crazy! Just can't figure it out.....

    Thanks for everyone's continued help!

  15. #15
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access Security (Access 2000)

    ADO connections are more persistent that DAO connections. Just switching to design view doesn't necessarily close the connection. You might try specifically closing the connection in the Unload event of the form and see if that cures the problem.
    Charlotte

Page 1 of 2 12 LastLast

Posting Permissions

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