Secure Database problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a secure database I want to display the user name in the Title Bar. To do
that I use:
CurrentDb.Properties("appTitle") = CurrentUser
Application.RefreshTitleBar
BUT, this is only possible if the user is a member of the Admins group.
I can't have all users in the Admins group, since that would enable them to
manage users and extend their own permissions.
Does anyone know how to get around this problem?
Thanks in advance, to anyone posting a suggestion.
Leif
 
Leif said:
In a secure database I want to display the user name in the Title
Bar. To do that I use:
CurrentDb.Properties("appTitle") = CurrentUser
Application.RefreshTitleBar
BUT, this is only possible if the user is a member of the Admins
group. [snip]

Why do you think this is required? I can think of no reason for that.
 
If you refer to the fact that I want the user name in the Title, it is
actually not just the user name I want there, it is the user name and the
name of a database.
I have an application that manages multiple databases in a front end - back
end configuration, and I want the user to always know which database he is
dealing with.

Rick Brandt said:
Leif said:
In a secure database I want to display the user name in the Title
Bar. To do that I use:
CurrentDb.Properties("appTitle") = CurrentUser
Application.RefreshTitleBar
BUT, this is only possible if the user is a member of the Admins
group. [snip]

Why do you think this is required? I can think of no reason for that.
 
Leif said:
If you refer to the fact that I want the user name in the Title, it is
actually not just the user name I want there, it is the user name and
the name of a database.
I have an application that manages multiple databases in a front end
- back end configuration, and I want the user to always know which
database he is dealing with.

But what requirement is there that all users be in the Admins group? Code that
sets the Application title need not be run by an administrator.
 
I am happy to hear that, but that's my problem!
If the user is not a member of the Admins group, these statements fails.
I am not at work now, but I believe the error is that there is no
permissions on the MSysDb object!
 
Leif Hansen said:
I am happy to hear that, but that's my problem!
If the user is not a member of the Admins group, these statements fails.
I am not at work now, but I believe the error is that there is no
permissions on the MSysDb object!

Well I could be mistaken of course, but I have a secured app that I haven't
worked on in a while and I'm pretty sure I am setting the Application TitleBar
at startup to include the revision number of the application. I don't recall
any sort of permission issues when I set that up, but let me review it and I'll
post back what I find.
 
I am happy to hear that, but that's my problem!
If the user is not a member of the Admins group, these statements fails.
I am not at work now, but I believe the error is that there is no
permissions on the MSysDb object!

I've had the same problem. I think there's some limitation as to who can
change the title bar. I ended up not doing it.

Jesper
 
That is very much appreciated!
Thanks

Rick Brandt said:
Well I could be mistaken of course, but I have a secured app that I haven't
worked on in a while and I'm pretty sure I am setting the Application TitleBar
at startup to include the revision number of the application. I don't recall
any sort of permission issues when I set that up, but let me review it and I'll
post back what I find.
 
Leif Hansen said:
That is very much appreciated!
Thanks

I created a brand new secured database and was able to use the code example in
the help file to change the application title while logged in as a user with
minimal permissions. I used Access 97 for the test so unless something was
changed I assume that this should work.
 
Well, I tried in Access97 and that works, but using the same code in
Access2003, I get the missing permissions on MSysDb.
Is it possible to temporarily switch user, just while running this piece of
code?
 
I have found the answer, from Larry Steel at
http://www.access-programmers.co.uk/forums/

--------------------------------------
'Copy this into a public module
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA"
(ByVal hwnd As Long, ByVal lpString As String) As Long

Public Sub SetFormTitle(frm As Form, TitleText As String)
Dim fhWnd As Long
fhWnd = frm.hwnd
SetWindowText fhWnd, TitleText
End Sub

Public Sub SetAppTitle(TitleText As String)
SetWindowText Application.hWndAccessApp, TitleText
End Sub

'Copy this into the the forms OnOpen event
Private Sub Form_Open(Cancel As Integer)
SetFormTitle Me, ""
SetAppTitle "My Application Title Here"
End Sub

Courtesy of Larry Steele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top