Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: R: Re: R: Re: R: Re: hidding Tables


Message #1 by Bohus Peter <peter.bohus@l...> on Wed, 31 Jul 2002 12:21:36 +0200
Brian

Many thanks for your comments.

Really I was surprised that in previous SecureDatabase function  you 
did not
give any return value and  you terminated function with end sub. For 
that
reason I met immediately error in compiling.

Well I applied all changes as you recommended in last two messages. Now 
I
got error message ERROR 13 (Type mismatch)


Best regards

Peter

> -----Messaggio originale-----
> Da:	braxis@b... [SMTP:braxis@b...]
> Inviato:	mercoled=EC 31 luglio 2002 11.52
> A:	Access
> Oggetto:	[access] Re: R: Re: R: Re: hidding Tables
>
> And even more apologies Peter. Access 2000 has caught me out with 
some
> sloppy coding!
>
> ChangePropertyDdl is a FUNCTION, so should be called like this:
>
> Public Function SecureDatabase()
> Dim bolResult As Boolean
>
>     bolResult =3D ChangePropertyDdl("AllowBypassKey", dbBoolean, 
False)
>     bolResult =3D ChangePropertyDdl("AllowBreakIntoCode", dbBoolean, 
False)
>     bolResult =3D ChangePropertyDdl("StartupShowDBWindow", dbBoolean, 
False)
>     bolResult =3D ChangePropertyDdl("StartupShowStatusBar", 
dbBoolean, True)
>     bolResult =3D ChangePropertyDdl("AllowBuiltinToolbars", 
dbBoolean,
> False)
>     bolResult =3D ChangePropertyDdl("AllowShortcutMenus", dbBoolean, 
False)
>     bolResult =3D ChangePropertyDdl("AllowBuiltInToolbars", 
dbBoolean,
> False)
>     bolResult =3D ChangePropertyDdl("AllowFullMenus", dbBoolean, 
False)
>     bolResult =3D ChangePropertyDdl("AllowToolbarChanges", dbBoolean, 
False)
>     bolResult =3D ChangePropertyDdl("AllowSpecialKeys", dbBoolean, 
False)
>   
> End Function
>
>
> Brian
>
> P.S. Don't forget to make a reference to the Microsoft DAO x.x Object
> Library too.
>
> >  from:    Bohus Peter <peter.bohus@l...>
> >  date:    Wed, 31 Jul 2002 08:47:53
> >  to:      access@p...
> >  subject: Re: [access] R: Re: R: Re: hidding Tables
> >
> > Brian,
> >
> > Thanks for your comment. It is very clear since it gives full
> explanation
> > what and how "property" is being changed using SecureDatabase 
public
> > function.
> > According to your  previous suggestion I have copied both functions
> > (SecureDatabase, ChangePropertyDdl) into new module of a back-end 
mdb
> > (before contained only tables to be linked) and then  I have 
launched
> > ?SecureDatabase  in immediate window. Doing it under Access 97 
special
> error
> > message comes as "Visual Basic  cannot recognise automatism", while
> working
> > in Access2000
> > I met compile error  (Type Mismatch).
> > I don't know what is wrong.
> >
> > Best regards
> >
> > Peter
> >
> >
> > > -----Messaggio originale-----
> > > Da:	braxis@b... [SMTP:braxis@b...]
> > > Inviato:	venerd=EC 26 luglio 2002 14.54
> > > A:	Access
> > > Oggetto:	[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=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...
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > ---
> > > > > > Change your mail options at http://p2p.wrox.com/manager.asp 
or
> > > > > >
> > > > > > ---
> > > > > > Change your mail options at http://p2p.wrox.com/manager.asp 
or
> > > > >
> > > > >
> > > > > ---
> > > > > Change your mail options at http://p2p.wrox.com/manager.asp 
or
> > > >
> > >
> > >
> >
>
>
Message #2 by braxis@b... on Wed, 31 Jul 2002 11:32:19 +0100 (BST)
Peter

Could you post the code you now have in your database, and let me know which version of Access the error is displayed in.

Brian

>  from:    Bohus Peter <peter.bohus@l...>
>  date:    Wed, 31 Jul 2002 11:21:36
>  to:      access@p...
>  subject: Re: [access] R: Re: R: Re: R: Re: hidding Tables
> 
> Brian
> 
> Many thanks for your comments.
> 
> Really I was surprised that in previous SecureDatabase function  you did not
> give any return value and  you terminated function with end sub. For that
> reason I met immediately error in compiling.
> 
> Well I applied all changes as you recommended in last two messages. Now I
> got error message ERROR 13 (Type mismatch)
> 
> 
> Best regards
> 
> Peter
> 



  Return to Index