General |
6.56 Disabilitare/abilitare l'effetto del tasto shift all'avvio. |
Federico Luciani |
Public Function bypassKey(bolVal As Boolean, Optional strMdb As String) As Boolean 'Autore: Federico Luciani 'Accetta: ' bolVal = True: abilita; False: disabilita ' strMdb = [Opz.] percorso+nome del database 'Restituisce: True l'operazione e' stata eseguita correttamente On Error GoTo bypass_Err Dim wrk As Workspace Dim dbs As Database Set wrk = DBEngine.Workspaces(0) If strMdb = "" Then Set dbs = CurrentDb() Else Set dbs = wrk.OpenDatabase(strMdb) End If dbs.Properties("AllowBypassKey") = bolVal bypassKey = True Set dbs = Nothing Set wrk = Nothing Exit Function bypass_Err: If Err = 3270 Then Dim prp As Property Set prp = dbs.CreateProperty("AllowBypassKey", dbBoolean, True) dbs.Properties.Append prp Resume Else MsgBox Err.Number & " - " & Err.Description bypassKey = False End If End FunctionPer provare la funzione inseritela in un altro mdb e dalla finestra di debug eseguite: ?bypassKey(False ,"C:\tuo.mdb") 'per disabilitare ?bypassKey(True ,"C:\tuo.mdb") 'per abilitare E' vivamente sconsigliato utilizzare questo sistema per proteggere il proprio lavoro. |