[ raspudic @ 26.04.2006. 07:01 ] @
Pošto znani kod za ovu funkciju NE RADI u Access projektu prilažem ovaj koji PROVJERENO RADI. Public Function AddCustomConnectionProperty(strPropName As String, varPropValue As Variant) As Boolean ' Add custom properties to the AccessObjectProperties ' collection that is associated with an AccessObject object. Const conPropNotFoundError = 3265 On Error GoTo AddProp_Err With CurrentProject .Properties(strPropName) = varPropValue End With AddCustomConnectionProperty = True AddProp_Bye: Exit Function AddProp_Err: If Err = conPropNotFoundError Or Err = 2455 Then With CurrentProject.Properties .Add strPropName, varPropValue End With Resume Else MsgBox Err.Description AddCustomConnectionProperty = False Resume AddProp_Bye End If End Function I use the following routine to completly secure my databases: Public Function SecureDatabase() AddCustomConnectionProperty "AllowBypassKey", False AddCustomConnectionProperty "AllowBreakIntoCode", False AddCustomConnectionProperty "StartupShowDBWindow", False AddCustomConnectionProperty "StartupShowStatusBar", True AddCustomConnectionProperty "AllowBuiltinToolbars", False AddCustomConnectionProperty "AllowShortcutMenus", False AddCustomConnectionProperty "AllowBuiltInToolbars", False AddCustomConnectionProperty "AllowFullMenus", False AddCustomConnectionProperty "AllowToolbarChanges", False AddCustomConnectionProperty "AllowSpecialKeys", False End Function Treba napraviti skriveno dugme sa šifrom da možemo po potrebi aktivirati Shift key kada je to nama potrebno (da ne zalupimo vrata za sobom a ključ da ostane unutra...) Željko |