Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    Palestine
    Posts
    2

    Talking Unanswered: Lock My database

    Hello,

    Can anyone help me? I need to lock my access database to prevent the users from viewing the database window and it's contents (tables, forms, reports, modules, queries, macros).

    In normal case users can enter to the design mode and penetrate the startup settings by clicking the Shift key at the moment the database is opened, can I prevent them from doing this?

    Thanks in advance

    Amjad Harb

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Salam Effendi,

    Just type the next code as a Module

    '=================================

    Function ChangeProperty(PropName As String, PropTyp As Variant, PropVal As Variant) As Integer
    Dim db As Database, prp As Property
    Const conPropNotFoundError = 3270

    On Error GoTo ERR_ChangeProperty
    Set db = CurrentDb
    db.Properties(PropName) = PropVal
    ChangeProperty = True


    EXIT_ChangeProperty:
    Exit Function

    ERR_ChangeProperty:
    If Err = conPropNotFoundError Then
    Set prp = db.CreateProperty(PropName, PropTyp, PropVal)
    db.Properties.Append prp
    Resume Next
    Else ' Unknown given property
    ChangeProperty = False
    Resume EXIT_ChangeProperty
    End If
    End Function
    '=================================

    Then u can use the followings call:

    Call ChangeProperty("StartupShowDBWindow", dbBoolean, False)' Disable this property

    Call ChangeProperty("AllowBypassKey", dbBoolean, False)'Disable this property



    Good luck and have nice time


    from:
    Mohammad Salah in Germany 15 Okt. 2003

  3. #3
    Join Date
    Aug 2003
    Location
    Palestine
    Posts
    2

    Talking Shukran

    Salam Effendi,

    Thank you for your helpfull code, hope to co-operate in the future.

Posting Permissions

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