Re: Opening codes
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Fri, 6 Jun 2008 09:35:53 -0400
<picky>
The comment that the process is not reversable is incorrect, especially
given the syntax used for the CreateProperty method. Even when using the
more secure syntax shown in http://www.mvps.org/access/general/gen0040.htm
the process can be reversed by anyone with Admin permissions on the database
</picky>
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Joao" <Joao@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:86F11BAC-2D77-4047-84B1-7E58FBDAD411@xxxxxxxxxxxxxxxx
Use this code:
Function ap_DisableShift()
'This function will disable the shift at startup causing the Autoexec
macro
& Startup properties to always be executed
On Error GoTo errDisableShift
'This Function will disable the shift at startup causing the Autoexec
macro
and startup properties to always be executed
'!!! WARNING !!!This proces is not reversable!!!!!
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
'This next line disables the shift key on startup.
db.Properties("AllowByPassKey") = False
Exit Function
errDisableShift:
' The first part of this error routine creates the "AllowByPassKey
property if it does not exist.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function 'ap_DisableShift' did not complete
successfully."
Exit Function
End If
'The error-handling routine above starting with the line
'errDisableShift:
'If the AllowByPassKey property doesn't exist - which it doesn't by
default
- the routine creates it and sets it to false.
'To enable the shift key to be used again on database startup : The only
difference from ap_DisableShift() is that
'False is changed to True when setting the AllowByPassKey property.
End Function
Remember, before using this code, backup your DB.
"Deanna" wrote:
Thank you!!! I have everything ready, switchboard & links etc. I would
also
like to create an electronic library, do i need to install VB for this or
can
i do this through access (2007)??
--
Dee
"Linq Adams via AccessMonster.com" wrote:
Goto Tools - Startup
Uncheck the "Display Database Window"
This means the Dialog box where you can click on Forms, Tables,
Queries, etc
will not appear, unless you hold down the <Shift> key as you open the
db.
If you do this, then obviously you have to use a series of "menu" or
"switchboard" forms to lead your users thru your database, giving them
access
to whatever objects you want them to have access to. The initial form
needs
to be selected, in this same place, Tools - Startup, in the "Display
Form/Page" box.
This, of course, only supplies limited security. As you've already
stated,
holding <Shift> down when opening the database will show the Database
Window,
as will pressing <F11> while the database is open. Security here, as
most
places, depends on who/what you're trying to protect your database
from. This
will work if you simply want to prevent non-Access savvy users from
snooping.
--
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200806/1
.
- Follow-Ups:
- Re: Opening codes
- From: Joao
- Re: Opening codes
- References:
- Re: Opening codes
- From: Linq Adams via AccessMonster.com
- Re: Opening codes
- From: Joao
- Re: Opening codes
- Prev by Date: RE: Can't Find Project or Library
- Next by Date: RE: Can't Find Project or Library
- Previous by thread: Re: Opening codes
- Next by thread: Re: Opening codes
- Index(es):
Relevant Pages
|