|
 |
access thread: R: Re: hidding Tables
Message #1 by Bohus Peter <peter.bohus@l...> on Fri, 26 Jul 2002 13:57:06 +0200
|
|
Hello Brian,
Can you tell me why it is not possible (or how it is possible ) to
write
functions in order to see such hidden tables which were made , for
example
according to your functions.
Best regards, ciao
Peter
> -----Messaggio originale-----
> Da: braxis@b... [SMTP:braxis@b...]
> Inviato: venerd=EC 26 luglio 2002 12.22
> A: Access
> Oggetto: [access] Re: hidding Tables
>
> Ahmed
>
> Create a new code module and then paste both functions into the
module.
>
> To run the code, open the VBE Immediate Window, type ?SecureDatabase
and
> press <return>.
>
> Brian
>
> > from: Ahmed Khamis <Ahmed.Khamis@v...>
> > date: Fri, 26 Jul 2002 12:10:25
> > to: access@p...
> > cc: braxis@b...
> > subject: Re: [access] Re: hidding Tables
> >
> > Kindly could you please clarify more how can I add it and in which
place
> exactly in the data base.
> >
> >
> > Best regards,
> >
> > Ahmed Khamis
> > Vodafone Egypt
> > Customer operation
> > Mob: xxx-xxx-xxxx
> > Ext:56-1107
> > Ahmed.khamis@v...
> >
> > -----Original Message-----
> > From: braxis@b... [mailto:braxis@b...]
> > Sent: Friday, July 26, 2002 11:53 AM
> > To: Access
> > Subject: [access] Re: hidding Tables
> >
> > Ahmed
> >
> > Here's how to totally secure a database. Add the following code to
your
> database and run the SecureDatabase function.
> >
> > WARNING!!! Do not run this on the development copy of your
database, as
> YOU will not be able to edit anything either!
> >
> > Public Function SecureDatabase()
> >
> > ChangePropertyDdl"AllowBypassKey",dbBoolean, False
> > ChangePropertyDdl"AllowBreakIntoCode",dbBoolean, False
> ChangePropertyDdl"StartupShowDBWindow",dbBoolean, False
> > ChangePropertyDdl"StartupShowStatusBar",dbBoolean, True
> ChangePropertyDdl"AllowBuiltinToolbars",dbBoolean, False
> > ChangePropertyDdl"AllowShortcutMenus",dbBoolean, False
> ChangePropertyDdl"AllowBuiltInToolbars",dbBoolean, False
> > ChangePropertyDdl"AllowFullMenus",dbBoolean, False
> ChangePropertyDdl"AllowToolbarChanges",dbBoolean, False
> > ChangePropertyDdl"AllowSpecialKeys",dbBoolean, False
> >
> > End Sub
> >
> > ' *********** Code Start ***********
> > Function ChangePropertyDdl(stPropName As String, _
> > PropType As DAO.DataTypeEnum, vPropVal As Variant) _
> > As Boolean
> > ' Uses the DDL argument to create a property
> > ' that only Admins can change.
> > '
> > ' Current CreateProperty listing in Access help
> > ' is flawed in that anyone who can open the db
> > ' can reset properties, such as AllowBypassKey
> > '
> > On Error GoTo ChangePropertyDdl_Err
> >
> > Dim db As DAO.Database
> > Dim prp As DAO.Property
> >
> > Const conPropNotFoundError =3D 3270
> >
> > Set db =3D CurrentDb
> > ' Assuming the current property was created without
> > ' using the DDL argument. Delete it so we can
> > ' recreate it properly
> > db.Properties.Delete stPropName
> > Set prp =3D db.CreateProperty(stPropName, _
> > PropType, vPropVal, True)
> > db.Properties.Append prp
> >
> > ' If we made it this far, it worked!
> > ChangePropertyDdl =3D True
> >
> > ChangePropertyDdl_Exit:
> > Set prp =3D Nothing
> > Set db =3D Nothing
> > Exit Function
> >
> > ChangePropertyDdl_Err:
> > If Err.Number =3D conPropNotFoundError Then
> > ' We can ignore when the prop does not exist
> > Resume Next
> > End If
> > Resume ChangePropertyDdl_Exit
> > End Function
> >
> >
> > > from: Ahmed Khamis <Ahmed.Khamis@v...>
> > > date: Fri, 26 Jul 2002 11:14:53
> > > to: access@p...
> > > subject: Re: [access] hidding Tables
> > >
> > > Good day All;
> > >
> > > How can I prevent other users from either viewing
or
> editing the tables of an MDE file
> > >
> > >
> > > Best regards,
> > >
> > > Ahmed Khamis
> > > Vodafone Egypt
> > > Customer operation
> > > Mob: xxx-xxx-xxxx
> > > Ext:56-1107
> > > Ahmed.khamis@v...
> > >
> > >
> >
> >
> >
>
>
Message #2 by braxis@b... on Fri, 26 Jul 2002 13:53:32 +0100 (BST)
|
|
Peter
This code prevents the user from ever seeing the database - all they have a
ccess to is the forms and reports the designer has provided for them.
Here is how the various parts work:
AllowBypassKey - Prevents the user from holding the <shift> key down when s
tating the database to overide the startup options/autoexec macro
StartupShowDBWindow - Prevents the user from seeing the database window. Th
erefore they have no access to tables, quries, etc.
AllowBreakIntoCode - Prevents the user from pressing <ctrl><break> and gett
ing into the VBE if a code error occours
AllowBuiltinToolbars - Tells Access not to display the built-in default too
lbar for a form. Only the toolbar specified by the designer will be display
ed. Prevents the user from switching to design view, or unhiding the databa
se window.
AllowShortcutMenus - Does the same as above for the default right-click men
us.
AllowFullMenus - Not sure about this one! Need to go back to my source.
AllowToolbarChanges - Prevents the user from designing their own toolbar wh
ich would give them back the functionality you have just denied them.
AllowSpecialKeys - Prevents the standard Access short cut keys from working
, such as <alt><F11> to open the VBE.
Of course, if you haven't implemented Access security, and restricted admin
access to the database, the above won't prevent your database being altere
d, using code, from a second database!
> from: Bohus Peter <peter.bohus@l...>
> date: Fri, 26 Jul 2002 12:57:06
> to: access@p...
> subject: Re: [access] R: Re: hidding Tables
>
> Hello Brian,
>
> Can you tell me why it is not possible (or how it is possible ) to write
> functions in order to see such hidden tables which were made , for exam
ple
> according to your functions.
>
>
> Best regards, ciao
>
> Peter
> > -----Messaggio originale-----
> > Da:=09braxis@b... [SMTP:braxis@b...]
> > Inviato:=09venerd=EC 26 luglio 2002 12.22
> > A:=09Access
> > Oggetto:=09[access] Re: hidding Tables
> >
> > Ahmed
> >
> > Create a new code module and then paste both functions into the module.
> >
> > To run the code, open the VBE Immediate Window, type ?SecureDatabase an
d
> > press <return>.
> >
> > Brian
> >
> > > from: Ahmed Khamis <Ahmed.Khamis@v...>
> > > date: Fri, 26 Jul 2002 12:10:25
> > > to: access@p...
> > > cc: braxis@b...
> > > subject: Re: [access] Re: hidding Tables
> > >
> > > Kindly could you please clarify more how can I add it and in which pl
ace
> > exactly in the data base.
> > >
> > >
> > > Best regards,
> > >
> > > Ahmed Khamis
> > > Vodafone Egypt
> > > Customer operation
> > > Mob: xxx-xxx-xxxx
> > > Ext:56-1107
> > > Ahmed.khamis@v...
> > >
> > > -----Original Message-----
> > > From: braxis@b... [mailto:braxis@b...]
> > > Sent: Friday, July 26, 2002 11:53 AM
> > > To: Access
> > > Subject: [access] Re: hidding Tables
> > >
> > > Ahmed
> > >
> > > Here's how to totally secure a database. Add the following code to yo
ur
> > database and run the SecureDatabase function.
> > >
> > > WARNING!!! Do not run this on the development copy of your database,
as
> > YOU will not be able to edit anything either!
> > >
> > > Public Function SecureDatabase()
> > >
> > > ChangePropertyDdl"AllowBypassKey",dbBoolean, False
> > > ChangePropertyDdl"AllowBreakIntoCode",dbBoolean, False
> > ChangePropertyDdl"StartupShowDBWindow",dbBoolean, False
> > > ChangePropertyDdl"StartupShowStatusBar",dbBoolean, True
> > ChangePropertyDdl"AllowBuiltinToolbars",dbBoolean, False
> > > ChangePropertyDdl"AllowShortcutMenus",dbBoolean, False
> > ChangePropertyDdl"AllowBuiltInToolbars",dbBoolean, False
> > > ChangePropertyDdl"AllowFullMenus",dbBoolean, False
> > ChangePropertyDdl"AllowToolbarChanges",dbBoolean, False
> > > ChangePropertyDdl"AllowSpecialKeys",dbBoolean, False
> > >
> > > End Sub
> > >
> > > ' *********** Code Start ***********
> > > Function ChangePropertyDdl(stPropName As String, _
> > > PropType As DAO.DataTypeEnum, vPropVal As Variant) _
> > > As Boolean
> > > ' Uses the DDL argument to create a property
> > > ' that only Admins can change.
> > > '
> > > ' Current CreateProperty listing in Access help
> > > ' is flawed in that anyone who can open the db
> > > ' can reset properties, such as AllowBypassKey
> > > '
> > > On Error GoTo ChangePropertyDdl_Err
> > >
> > > Dim db As DAO.Database
> > > Dim prp As DAO.Property
> > >
> > > Const conPropNotFoundError =3D 3270
> > >
> > > Set db =3D CurrentDb
> > > ' Assuming the current property was created without
> > > ' using the DDL argument. Delete it so we can
> > > ' recreate it properly
> > > db.Properties.Delete stPropName
> > > Set prp =3D db.CreateProperty(stPropName, _
> > > PropType, vPropVal, True)
> > > db.Properties.Append prp
> > >
> > > ' If we made it this far, it worked!
> > > ChangePropertyDdl =3D True
> > >
> > > ChangePropertyDdl_Exit:
> > > Set prp =3D Nothing
> > > Set db =3D Nothing
> > > Exit Function
> > >
> > > ChangePropertyDdl_Err:
> > > If Err.Number =3D conPropNotFoundError Then
> > > ' We can ignore when the prop does not exist
> > > Resume Next
> > > End If
> > > Resume ChangePropertyDdl_Exit
> > > End Function
> > >
> > >
> > > > from: Ahmed Khamis <Ahmed.Khamis@v...>
> > > > date: Fri, 26 Jul 2002 11:14:53
> > > > to: access@p...
> > > > subject: Re: [access] hidding Tables
> > > >
> > > > Good day All;
> > > >
> > > > How can I prevent other users from either viewing or
> > editing the tables of an MDE file
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Ahmed Khamis
> > > > Vodafone Egypt
> > > > Customer operation
> > > > Mob: xxx-xxx-xxxx
> > > > Ext:56-1107
> > > > Ahmed.khamis@v...
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
Message #3 by Chris Seier <chrisseier@c...> on Fri, 26 Jul 2002 18:49:06 -0400
|
|
I'm doing something similar using a custom security module...not the Access
security module.
I use a Developer Toolbar to open the Startup and Customize menus. I sign in
as the developer and then exit and come back in holding the shift key. To
reset the locks, sign in as a user other than developer, exit and come back
in as a user other than developer.
May not be as nice as the Access security module but, I don't have any
experience with that and this DB if for my wife to use at work and she won't
want to mess with setting up users etc...
See the code below.
Hope it helps.
Chris
Here's how I do it behind my Login form:
Private Sub Form_Open(Cancel As Integer)
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False
ChangeProperty "AllowShortcutMenus", DB_Boolean, False
DoCmd.ShowToolbar "Developer", acToolbarNo
DoCmd.ShowToolbar "Administrator Tools", acToolbarNo
DoCmd.Maximize
End Sub
Private Sub Password_AfterUpdate()
Select Case Me.Password
Case "Communications Manage Password" 'Sign in as Communications Manager
DoCmd.OpenForm "frmDetectIdleTime", acNormal, , , , acHidden
DoCmd.OpenForm "frmMain Menu", acNormal
Forms![frmMain Menu]![cmdImport Data].Visible = False
Forms![frmMain Menu]![cmdAdministration].Visible = False
Forms![frmMain Menu]![UserMode] = "Communications Manager"
Case "Wan Admin Password" 'Sign in as Wan Administrator
DoCmd.ShowToolbar "Administrator Tools", acToolbarYes
DoCmd.OpenForm "frmDetectIdleTime", acNormal, , , , acHidden
DoCmd.OpenForm "frmMain Menu", acNormal
Forms![frmMain Menu]![UserMode] = "Wan Administrator"
Case "Developer Password" 'Sign in as Developer
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
ChangeProperty "AllowShortcutMenus", DB_Boolean, True
DoCmd.ShowToolbar "Developer", acToolbarYes
DoCmd.SelectObject acForm, "frmMain Menu", True
DoCmd.Close acForm, "frmLogin", acSaveNo
Case Else 'Wrong Password. Try again or kick user out.
Me.Password = Null
If vbYes = MsgBox("Wrong Password." & _
vbCrLf & _
"Exit Database?", _
vbYesNo + vbCritical) Then
DoCmd.Quit
End If
End Select
> -----Original Message-----
> From: braxis@b... [mailto:braxis@b...]
> Sent: Friday, July 26, 2002 8:54 AM
> To: Access
> Subject: [access] Re: R: Re: hidding Tables
>
>
> Peter
>
> This code prevents the user from ever seeing the database - all
> they have access to is the forms and reports the designer has
> provided for them.
>
> Here is how the various parts work:
>
> AllowBypassKey - Prevents the user from holding the <shift> key
> down when stating the database to overide the startup
> options/autoexec macro
>
> StartupShowDBWindow - Prevents the user from seeing the database
> window. Therefore they have no access to tables, quries, etc.
>
> AllowBreakIntoCode - Prevents the user from pressing
> <ctrl><break> and getting into the VBE if a code error occours
>
> AllowBuiltinToolbars - Tells Access not to display the built-in
> default toolbar for a form. Only the toolbar specified by the
> designer will be displayed. Prevents the user from switching to
> design view, or unhiding the database window.
>
> AllowShortcutMenus - Does the same as above for the default
> right-click menus.
>
> AllowFullMenus - Not sure about this one! Need to go back to my source.
>
> AllowToolbarChanges - Prevents the user from designing their own
> toolbar which would give them back the functionality you have
> just denied them.
>
> AllowSpecialKeys - Prevents the standard Access short cut keys
> from working, such as <alt><F11> to open the VBE.
>
> Of course, if you haven't implemented Access security, and
> restricted admin access to the database, the above won't prevent
> your database being altered, using code, from a second database!
>
>
> > from: Bohus Peter <peter.bohus@l...>
> > date: Fri, 26 Jul 2002 12:57:06
> > to: access@p...
> > subject: Re: [access] R: Re: hidding Tables
> >
> > Hello Brian,
> >
> > Can you tell me why it is not possible (or how it is possible
> ) to write
> > functions in order to see such hidden tables which were made
> , for example
> > according to your functions.
> >
> >
> > Best regards, ciao
> >
> > Peter
> > > -----Messaggio originale-----
> > > Da: braxis@b... [SMTP:braxis@b...]
> > > Inviato: venerd́ 26 luglio 2002 12.22
> > > A: Access
> > > Oggetto: [access] Re: hidding Tables
> > >
> > > Ahmed
> > >
> > > Create a new code module and then paste both functions into
> the module.
> > >
> > > To run the code, open the VBE Immediate Window, type
> ?SecureDatabase and
> > > press <return>.
> > >
> > > Brian
> > >
> > > > from: Ahmed Khamis <Ahmed.Khamis@v...>
> > > > date: Fri, 26 Jul 2002 12:10:25
> > > > to: access@p...
> > > > cc: braxis@b...
> > > > subject: Re: [access] Re: hidding Tables
> > > >
> > > > Kindly could you please clarify more how can I add it and
> in which place
> > > exactly in the data base.
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Ahmed Khamis
> > > > Vodafone Egypt
> > > > Customer operation
> > > > Mob: xxx-xxx-xxxx
> > > > Ext:56-1107
> > > > Ahmed.khamis@v...
> > > >
> > > > -----Original Message-----
> > > > From: braxis@b... [mailto:braxis@b...]
> > > > Sent: Friday, July 26, 2002 11:53 AM
> > > > To: Access
> > > > Subject: [access] Re: hidding Tables
> > > >
> > > > Ahmed
> > > >
> > > > Here's how to totally secure a database. Add the following
> code to your
> > > database and run the SecureDatabase function.
> > > >
> > > > WARNING!!! Do not run this on the development copy of your
> database, as
> > > YOU will not be able to edit anything either!
> > > >
> > > > Public Function SecureDatabase()
> > > >
> > > > ChangePropertyDdl"AllowBypassKey",dbBoolean, False
> > > > ChangePropertyDdl"AllowBreakIntoCode",dbBoolean, False
> > > ChangePropertyDdl"StartupShowDBWindow",dbBoolean, False
> > > > ChangePropertyDdl"StartupShowStatusBar",dbBoolean, True
> > > ChangePropertyDdl"AllowBuiltinToolbars",dbBoolean, False
> > > > ChangePropertyDdl"AllowShortcutMenus",dbBoolean, False
> > > ChangePropertyDdl"AllowBuiltInToolbars",dbBoolean, False
> > > > ChangePropertyDdl"AllowFullMenus",dbBoolean, False
> > > ChangePropertyDdl"AllowToolbarChanges",dbBoolean, False
> > > > ChangePropertyDdl"AllowSpecialKeys",dbBoolean, False
> > > >
> > > > End Sub
> > > >
> > > > ' *********** Code Start ***********
> > > > Function ChangePropertyDdl(stPropName As String, _
> > > > PropType As DAO.DataTypeEnum, vPropVal As Variant) _
> > > > As Boolean
> > > > ' Uses the DDL argument to create a property
> > > > ' that only Admins can change.
> > > > '
> > > > ' Current CreateProperty listing in Access help
> > > > ' is flawed in that anyone who can open the db
> > > > ' can reset properties, such as AllowBypassKey
> > > > '
> > > > On Error GoTo ChangePropertyDdl_Err
> > > >
> > > > Dim db As DAO.Database
> > > > Dim prp As DAO.Property
> > > >
> > > > Const conPropNotFoundError = 3270
> > > >
> > > > Set db = CurrentDb
> > > > ' Assuming the current property was created without
> > > > ' using the DDL argument. Delete it so we can
> > > > ' recreate it properly
> > > > db.Properties.Delete stPropName
> > > > Set prp = db.CreateProperty(stPropName, _
> > > > PropType, vPropVal, True)
> > > > db.Properties.Append prp
> > > >
> > > > ' If we made it this far, it worked!
> > > > ChangePropertyDdl = True
> > > >
> > > > ChangePropertyDdl_Exit:
> > > > Set prp = Nothing
> > > > Set db = Nothing
> > > > Exit Function
> > > >
> > > > ChangePropertyDdl_Err:
> > > > If Err.Number = conPropNotFoundError Then
> > > > ' We can ignore when the prop does not exist
> > > > Resume Next
> > > > End If
> > > > Resume ChangePropertyDdl_Exit
> > > > End Function
> > > >
> > > >
> > > > > from: Ahmed Khamis <Ahmed.Khamis@v...>
> > > > > date: Fri, 26 Jul 2002 11:14:53
> > > > > to: access@p...
> > > > > subject: Re: [access] hidding Tables
> > > > >
> > > > > Good day All;
> > > > >
> > > > > How can I prevent other users from either viewing or
> > > editing the tables of an MDE file
> > > > >
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Ahmed Khamis
> > > > > Vodafone Egypt
> > > > > Customer operation
> > > > > Mob: xxx-xxx-xxxx
> > > > > Ext:56-1107
> > > > > Ahmed.khamis@v...
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
>
>
>
|
|
 |