PC Review


Reply
Thread Tools Rate Thread

Admin always shows up as a user

 
 
=?Utf-8?B?U2ltb24gQ2xlYWw=?=
Guest
Posts: n/a
 
      31st May 2005
Im using the following snipet of code to populate a combo box with a list of
user IDs...

Dim objWorkSpace As Workspace
Set objWorkSpace = DBEngine.CreateWorkspace _("SPECIAL", "AdminUser",
"AdminPassword")
intCount = 0
cmbUserID.RowSource = objWorkSpace.Users(intCount).Name
For intCount = 1 To objWorkSpace.Users.Count - 1
Select Case objWorkSpace.Users(intCount).Name
Case "Creator", "Engine", "admin", "Admin" '***
Case Else
cmbUserID.RowSource = cmbUserID.RowSource & ";" & _
objWorkSpace.Users(intCount).Name
End Select
Next intCount
objWorkSpace.Close
Set objWorkSpace = Nothing


The line of code I've marked with *** is designed to prevent the user from
seeing any userIDs I feel would 'confuse' them (it doesnt take much to
'confuse' my users!)

Despite that line of code a User ID called admin (but not Engine or Creator)
always comes up in the combo box!

Can anyone explain why and how I can get rid of it?

Thanks in advance

Simon
 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      1st Jun 2005
Urk! I stopped on the createworkspace. You do not need to create a
worksace, to get the list of current users & groups in the current
workgroup file.

This will do it:

dim u as user
for each u in dbengine(0).users
msgbox u.name
next

I suggest that you rewrite your snippet, then try again.

Note that normal VBA comparisons are case insensitive. You don't need
to check "admin" /and/ "Admin" - either one will do (though for
readability, I always code as if the tests /are/ case sensitive).

HTH,
TC

 
Reply With Quote
 
=?Utf-8?B?U2ltb24gQ2xlYWw=?=
Guest
Posts: n/a
 
      1st Jun 2005
Thanks TC Ive revised my code, Ive also spotted my "delibarate" mistake lol


"TC" wrote:

> Urk! I stopped on the createworkspace. You do not need to create a
> worksace, to get the list of current users & groups in the current
> workgroup file.
>
> This will do it:
>
> dim u as user
> for each u in dbengine(0).users
> msgbox u.name
> next
>
> I suggest that you rewrite your snippet, then try again.
>
> Note that normal VBA comparisons are case insensitive. You don't need
> to check "admin" /and/ "Admin" - either one will do (though for
> readability, I always code as if the tests /are/ case sensitive).
>
> HTH,
> TC
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Stop a admin user changing another admin users password or deleting their account? Poutnik Windows Vista General Discussion 4 6th Oct 2009 11:00 PM
Re: Stop a admin user changing another admin users password or deleting their account? Rick Rogers Windows Vista General Discussion 0 3rd Oct 2009 12:33 PM
domain admin user who cant add other people to the admin group? Jane Microsoft Windows 2000 Active Directory 1 21st Jul 2005 11:39 PM
How to prevent admin (or admin user) from signing on when I am on and station is locked ? Mark Windows XP General 13 10th Nov 2003 02:18 PM
Non-admin user can't use programs installed by Admin user Andrew White Windows XP General 0 24th Aug 2003 11:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:19 AM.