Results 1 to 6 of 6
  1. #1
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16

    Angry Unanswered: disable allowbypass=false

    Hi to all,

    I have a small security issue with my db.

    The properties:
    1. startup form=xxx
    2. all the checkboxes in startup are false
    3. an autoexec module for allowbypass=false
    4. the vb code protected with password.

    The problem:
    The problem is that i can't enter in db design anymore since i set the bypass=false.

    The story:
    I was playing with the code and now...Stupid, huh?

    Action:
    I try to import all the tbl, frm, mcr and module, but i can't import the cod of the forms and the module because is password protected. There is no option to type the password and go on!

    The question:
    Could anyone tell me the code to import all the db objects and tell to the db what password to use for the code???
    Theodor

  2. #2
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    Create a new database.
    Open a module
    If Access 2K/XP, set a reference to DAO 3.6. (Tools-References)

    Then paste the following code:

    Sub EnableByPassKey()
    Dim db As DAO.Database
    Set db = DbEngine.OpenDatabase("C:\Path\File.mdb")
    db.Properties.Delete "AllowBypassKey"
    Set db = Nothing
    End Sub

    Run the code and you should be home free...

    Good luck

  3. #3
    Join Date
    Mar 2003
    Location
    Romania
    Posts
    32
    Hello,

    I don't know what have you done to protect your code but I have had similar problems in the past.

    You have to create a new database and insert those functions in a new module. Then call SetDebug with the dbPath you want to recover and setMode=True:

    Private Sub SetDebug(dbPath As String, setMode As Boolean)
    Dim dbs As Database
    Set dbs = DBEngine.Workspaces(0).OpenDatabase(dbPath)
    ChangeProperty dbs, "StartupShowDBWindow", dbBoolean, setMode
    ChangeProperty dbs, "AllowBuiltinToolbars", dbBoolean, setMode
    ChangeProperty dbs, "AllowFullMenus", dbBoolean, setMode
    ChangeProperty dbs, "AllowBreakIntoCode", dbBoolean, setMode
    ChangeProperty dbs, "AllowSpecialKeys", dbBoolean, setMode
    ChangeProperty dbs, "AllowBypassKey", dbBoolean, setMode
    ChangeProperty dbs, "AllowShortcutMenus", dbBoolean, setMode
    ChangeProperty dbs, "AllowToolbarChanges", dbBoolean, setMode
    End Sub

    Function ChangeProperty(dbs As Database, strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim prp As Property
    Const conPropNotFoundError = 3270

    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

    Change_Bye:
    Exit Function

    Change_Err:
    If Err = conPropNotFoundError Then ' Property not found.
    Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
    dbs.Properties.Append prp
    Resume Next
    Else
    ' Unknown error.
    MsgBox Err.Description
    ChangeProperty = False
    Resume Change_Bye
    End If
    End Function

    Let me know if it works.
    Florin Profeanu
    floreanuprofin@yahoo.com

  4. #4
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16
    Merci Dany, merci Florin!
    Am incercat ambele variante, dar se pare ca am niste probleme cu DAO si nu merge nici una.
    Am tot instalat si dezinstalat de pe computer. O sa caut acum DAO si va spun pe urma cum a mers.
    Oricum codul pare foarte logic. Nu vad de ce nu ar merge.

    Merci mult baieti!
    Ne mai auzim!
    Theodor

  5. #5
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16
    Gata..... Am rezolvat-o!
    Dany, formula ta a fost cel mai simplu de utilizat si a mers fara probleme! Merci.
    Florin, am incercat de curiozitate si ce mi-ai spus tu si nu am reusit sa-i dau de cap. Imi tot dadea o eroare cum ca nu suporta null value. Este vorba de prp. Tu l-ai incercat? La tine mergea? S-ar putea sa nu stiu eu sa-l folosesc cum trebuie. Merci frumos pentru raspuns.

    Hai sa ne mai auzim.

    ps. eu am descoperit formul acesta de 3 zile si nu pot decat sa ma bucur ca am cu cine sa vorbesc despre access si ca mai sunt si romani pe aici.
    Theodor

  6. #6
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    wow, sunt impresionat! LOL

    Probabil ai incercat sa creezi o proprietate si sa-i aloci null. Null nu e permis in proprietati definite de utilizator.

    Da-mi un mail la dan@NOSPAMartrom.ro (sterge NOSPAM din adresa) si iti dau un link catre un forum de Access exceptional. Asta e fleac...

    Pune un identificator, ceva in subiectul mesajului, altfel s-ar putea sa-l sterg fara sa ma uit la el...ce sa-i faci, prea mult spam

    S-ar putea sa sara moderatoru' pe noi ca vorbim romaneste, da' nu-i nici o problema...

    Dan

Posting Permissions

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