Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Database Container on Startup (Access 97 on Win 98)

    Has anyone tried to control the database container on startup? I would like to get the Tables tab to show as default. Instead, it opens to wherever I left it.

    Any ideas would be greatly appreciated.

    Cecilia <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Additional Startup woes

    Okay, I modified this code to identify whether the user is an admin (if so, show the db container) or an end user (don't show container & just run the code): [If you're an admin, you have a shortcut with Admin in the command line]

    Function CheckCommandLine()
    ' Check value returned by Command function.
    If Command = "Admin" Then
    SetStartupProperties True
    Else
    If SetStartupProperties(False) = True Then
    UpdateUsers 'automatically run update code
    End If
    End If
    End Function

    Function SetStartupProperties(blnProtected As Boolean) As Boolean
    SetStartupProperties = False
    ChangeProperty "StartupShowDBWindow", dbBoolean, blnProtected
    ChangeProperty "StartupShowStatusBar", dbBoolean, blnProtected
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, blnProtected
    ChangeProperty "AllowFullMenus", dbBoolean, blnProtected
    ChangeProperty "AllowBreakIntoCode", dbBoolean, False
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    ChangeProperty "AllowBypassKey", dbBoolean, True
    SetStartupProperties = True
    End Function

    Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    On Error GoTo HandleError
    Dim db As Database
    Dim prp As Property

    Const conPropNotFoundError = 3270
    Set db = CurrentDb()
    db.Properties(strPropName) = varPropValue
    ChangeProperty = True

    Exit Function

    HandleError:
    Select Case Err
    Case conPropNotFoundError
    Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
    db.Properties.Append prp
    Resume Next
    Case Else
    ChangeProperty = False
    MsgBox Err.Number & " " & Err.Description, , "Change Property Error"
    End Select

    End Function

    The problem is whether or not the container properties are set up properly....If I open the database with the admin shortcut, the first time the container will be locked down and won't show, but the end user code won't run. The second time I open it, the container will be (properly) open.

    If I open the db without the Admin command line, the opposite happens the first time (the container improperly shows), but the end user code (properly) runs. The second time around the container properly is hidden.

    As a side note, for some reason the default toolbar _always_ shows when you run the db as an end user (without the admin line).

    So what I'm dealing with is a delay in when the properties are effective for the database. Any ideas? Please? I'm going nuts about now & need to get this darned thing out the door.

    Cecilia <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Additional Startup woes

    Have you resolved your problem yet? I missed this question for some reason, and I discovered it today when I did a search for a similar issue. I believe this is an issue of properties not existing in the database until they are created - at least I have seen other posts relating to the issue of disabling the SHIFT key so people can't bypass the startup process. You may want to set all the properties in the Tools/Startup dialog so that by default everything is protected, and then check security and turn them on if the user is the admin account. Repost if you are still stuck and I'll try to help.
    Wendell

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Additional Startup woes

    The reason there seems to be a lag is because when you change the startup properties in code the changes do not take effect until the next time you open the mdb. In essence you are opening the mdb, the startup properties are read, you change the properties in your code, then the properties are read the next time you open the mdb. Clear as mud?

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Additional Startup woes

    Hi Wendell--

    Actually, this is exactly what I was trying to do. I locked down the db and then if the user was an Admin, opened it up. Worked great in theory, but not in practice. No matter what I did, the toolbar showed up as a User (even though it was turned off in the startup options) and either did or didn't show up as an Admin. To get the thing off my plate, I ended up doing something else altogether. But just to update you on that particular situation, I did read about doing it from the Startup dialog (ie. in a form), but that didn't work either.

    I'm just going to write it off as a MS "feature" and move on. I'm happier with the new design anyway.

    Thanks for asking, & happy Valentine's!

    Cecilia <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Additional Startup woes

    Hee hee! Yeah, that's evident. At least for some of the properties (If I open the db as a User, it lets me see the toolbar 100% of the time, whereas it should be at least 50% of the time). But this default changing properties for the next time is not what I want it to do. Oh, well.

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Additional Startup woes

    The other comments actually are correct - you are changing start-up properties, and since they only affect start-up, you won't see them till the next time you start-up. You mentioned a new design - I'm curious how you solved the probem. I was going to suggest that you consider giving the admin users a different front-end than the normal users. Either that or shut off the SHIFT key over-ride and put a hidden control that could be clicked which would let Admin users get into the database in a design mode. Happy Valentine's Day to you also.
    Wendell

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Additional Startup woes

    Actually, that's what I did--I scrapped the startup thing and gave the Admins a password protected hidden entrance. Not exactly what I was hoping for, but it functions for what I need.

    Thanks ;-)

Posting Permissions

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