Wrox Home  
Search P2P Archive for: Go

  Return to Index  

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


Message #1 by Bohus Peter <peter.bohus@l...> on Wed, 31 Jul 2002 15:25:46 +0200
Brian,

If I launch ?securedatabase in immediate window I meet Error 13 (Type
mismatch). In order to establish which code line causes  trouble in
compilation I put msgbox after each line. With this technique code runs
well and I did not find error message. At this point I have created a 
form
containing commandbutton. In its click event  when I'm calling
securedatabase  I don't get error. I verified after that mdb (tables) 
is
cannot be seen more, consequently I have got required results.

It is strange why I cannot launch execution  in immediate window. 
Usually in
the case of error the appropriate  code-line is going be indicated with
yellow colour but in this case this option does not work. I don't know 
why.

Thanks again.

Best regards

Peter

> -----Messaggio originale-----
> Da:	braxis@b... [SMTP:braxis@b...]
> Inviato:	mercoled=EC 31 luglio 2002 14.26
> A:	Access
> Oggetto:	[access] Re: R: Re: R: Re: R: Re: R: Re: hidding Tables
>
> Peter
>
> Worked fine for me!?!
>
> Can you mtell me which line produces the error?
>
> Brian
>
> >  from:    Bohus Peter <peter.bohus@l...>
> >  date:    Wed, 31 Jul 2002 11:48:00
> >  to:      access@p...
> >  subject: Re: [access] R: Re: R: Re: R: Re: R: Re: hidding Tables
> >
> > Dear Brian,
> >
> >
> > my version ACCESS  SR-1 (I don't know what SR 1 means)
> > herein the code:
> >
> > Option Compare Database
> > Option Explicit
> > ' this modul gives oppurtinity to make tables hidden, it is 
necessary to
> go
> > ' to immediate window and to type ?securedatabase and press enter
> >
> > 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 Sub
> > 
> >
> >  Function ChangePropertyDdl(stPropName As String, _
> >   PropType As Variant, vPropVal As Variant) _
> >   As Boolean
> >   ' in the case of Access 2000 PropType must be daclered as
> DAO.DataTypeEnum
> >   ' 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 3265 ' in the case of 
Access2000 this
> > constant 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
> > 
> >  Best regards
> >
> > peter
> > 
> >
> >
> >
> >
> > > -----Messaggio originale-----
> > > Da:	braxis@b... [SMTP:braxis@b...]
> > > Inviato:	mercoled=EC 31 luglio 2002 12.32
> > > A:	Access
> > > Oggetto:	[access] Re: R: Re: R: Re: R: Re: hidding Tables
> > >
> > > 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