|
 |
access thread: Securing Database Using Network Login
Message #1 by elizabeth_mohr@f... on Thu, 11 Oct 2001 18:53:45
|
|
Hi all,
A while back someone had posted a response showing how they captured the
NT network login of someone using their database and then used that login
to set security on the database. I think they said they would then use
VBA to say if the login is this person, they show them this form, if not,
show them a different form or something like that.
I've been testing this out and it works great, but the only problem I'm
having is that someone can hold down the Shift key while opening the
database, thereby bypassing the macro that determines what their login is.
Does anyone know how to restrict someone from bypassing the autoexec macro?
Thanks in advance for your help.
Message #2 by "Hamilton, Tom" <hamiltot@s...> on Thu, 11 Oct 2001 11:46:00 -0700
|
|
Hi Elizabeth,
Use the following code to block [Shift] key bypassing. There are some other
things you can do to within DAO which is really cool because there are ways
to
defeat this method. It is more difficult to defeat the block when the DAO
property is set.
First - the standard way;
ChangeProperty "AllowBypassKey", dbBoolean, false
Hi Elizabeth,
Use the following code to block [Shift] key bypassing. There are some other
things you can do to within DAO which is really cool because there are ways
to
defeat this method, but much mode difficult when the DAO property is set'
First - the standard way;
ChangeProperty "AllowBypassKey", dbBoolean, false
Which calls this function:
Function ChangeProperty(sPropName As String, _
vPropType As Variant, _
vPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(sPropName) = vPropValue
ChangeProperty = True
Change_Exit:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(sPropName, vPropType, vPropValue)
dbs.Properties.Append prp
Resume Next
Else ' Unknown error.
ChangeProperty = False
Resume Change_Exit
End If
End Function
If you're a database Admin and want a stronger method, go here:
http://www.mvps.org/access/general/gen0040.htm
Tom Hamilton
T_Systems, Inc
Database Programmer
(xxx) xxx-xxxx
>>> elizabeth_mohr@f... 10/11/01 11:53AM >>>
Hi all,
A while back someone had posted a response showing how they captured the
NT network login of someone using their database and then used that login
to set security on the database. I think they said they would then use
VBA to say if the login is this person, they show them this form, if not,
show them a different form or something like that.
I've been testing this out and it works great, but the only problem I'm
having is that someone can hold down the Shift key while opening the
database, thereby bypassing the macro that determines what their login is.
Does anyone know how to restrict someone from bypassing the autoexec macro?
Thanks in advance for your help.
|
|
 |