Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Login Procedure 1

Status
Not open for further replies.

dleiba

MIS
Aug 22, 2001
28
JM
Hey guys,

I am new to Microsoft Access and have successfully secured it using the Security Wizard.

Using tips and some books, I have also disabled the "shift-key" bypass as well as the F11 trick.

Presently, the users of this database access it by logging into a Citrix Server, then into Novell Netware 4.2 and then into the database itself.

My questions are as follows:

1) Is there anyway to programmatically integrate all 3 steps?

2) If not, can Access obtain Netware (or Citrix) login information and use this information to automatically log a user in?

3) Regarding the default system generated Logon Box, is there anyway to manipulate the settings for this box? I would like to remove the cancel button from it or change its functionality.

ANY help would be greatly appreciated!

Thanks in advance,
 
Hi!

There are codes for StartUp setting. You can call function on start of application for StartUp setting. Also this function set &quot;By pass key&quot; (allow or not to open application with <Shift> key ie. suspend StartUp), &quot;Special keys> False or True etc. It's important for users work. I made special form for calling this function and setting StartUp: form open is allowed only to Admins group users.


Private Sub On_Open()
If CurrentDb.Properties(&quot;AllowBypassKey&quot;)=True Then
'Here I check for permission of CurrentUser and
'If CurrentUser have not Admins group then I set

if IsUserInGroup=false then
NewAllowBypassKey = False
Call SetStartupProperties
'All settings will be in work after restarting app.
msgbox &quot;Please restart application!&quot;
docmd.quit
else
NewAllowBypassKey = true
Call SetStartupProperties
msgbox &quot;On next application's starting you will be opened it in dialog mode by using <Shift> key&quot;
end if
end if
end sub
'--------------------------
Public NewAllowBypassKey As Variant
'--------------------------
Function SetStartupProperties()

'Set DB icon
ChangeProperty &quot;AppIcon&quot;, dbText, & &quot;C:\MyFolder\MyIcon.ico&quot;
ChangeProperty &quot;AppTitle&quot;, dbText, &quot;My Database Name&quot;
ChangeProperty &quot;StartupForm&quot;, dbText, &quot;MyStartFormName&quot;
ChangeProperty &quot;StartupShowDBWindow&quot;, dbBoolean, False
ChangeProperty &quot;StartupShowStatusBar&quot;, dbBoolean, True
'or NewAllowBypassKey
ChangeProperty &quot;AllowBuiltinToolbars&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;AllowFullMenus&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;AllowBreakIntoCode&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;AllowSpecialKeys&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;AllowBypassKey&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;StartUpMenuBar&quot;, dbText, &quot;MyUserMenu&quot;
ChangeProperty &quot;AllowToolbarChanges&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;AllowShortcutMenus&quot;, dbBoolean, NewAllowBypassKey
ChangeProperty &quot;StartupShortcutMenuBar&quot;, dbBoolean, NewAllowBypassKey
End Function

'--------------------------
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

'--------------------------
Function IsUserInGroup(Optional strUser As String = &quot;&quot;, Optional strGroup As String = &quot;&quot;) As Boolean
'This is function for verifying of user's group
'If is omitted strUser (user name), CurrentUser is verified
'If is omitted strGroup (user group), &quot;Admins&quot; group is verified

On Error GoTo Err_IsUserInGroup
Dim usr As User

If strUser = &quot;&quot; Then strUser = CurrentUser
If strGroup = &quot;&quot; Then strGroup = &quot;Admins&quot;

Set usr = DBEngine.Workspaces(0).Groups(strGroup).Users(strUser)
'If group <strGroup> have not user <strUser> then error is generated
IsUserInGroup = True

Exit_IsUserInGroup:
Exit Function

Err_IsUserInGroup:
If Err.Number <> 3265 Then '3265 >>> Item not found in this collection:
'consequently IsUserInGroup = False

MsgBox &quot;Error No &quot; & Err.Number & vbLf & Err.Description, , &quot;Function IsUserInGroup&quot;
End If
Resume Exit_IsUserInGroup

End Function


Also look at thread181-123565

Here is site's address for learning more about MS Access Workgroup Administration:


For DB security you can use User-level security wizard
Push <Menu bar>;<Tools>;<Security>;<User-level security wizard...>

Aivars
 
Aivars,

Thanks for your speedy response.

I am still not comfortable with the system generated logon box. Is there any way to manipulate it programmatically?

Also, how can I programmatically reference a user's Netware login name and password AND use these values in Access?

Looking forward to your response.

Thanks once again!

Dominic Leiba
 
Hallo, Dominic!

After you'll be created Workgroup file (.MDW) Access always will show logon window on start of any application. Follow advices of post above...

Good luck!
Aivars
alaganovskis@hotmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top