DAO to check if a user exists

  • Thread starter Thread starter Tony_VBACoder
  • Start date Start date
T

Tony_VBACoder

With security applied to an Access 2002 database, how can
I check if a user exists using DAO?
 
Tony_VBACoder said:
With security applied to an Access 2002 database, how can
I check if a user exists using DAO?

Keep in mind that what you are checking is whether the user is in the
workgroup file in use, not the database..
From the security FAQ:

Dim ws as Workspace
Dim StrUser as String
Set ws = DBEngine.Workspaces(0)
On Error Resume Next
strUser = ws.Users("Tony").Name
If Err.Number = 0
'the user exists
Else
'they don't
End If
 
Yes, that is exactly what I wanted.

Thanks

-----Original Message-----


Keep in mind that what you are checking is whether the user is in the
workgroup file in use, not the database..
From the security FAQ:

Dim ws as Workspace
Dim StrUser as String
Set ws = DBEngine.Workspaces(0)
On Error Resume Next
strUser = ws.Users("Tony").Name
If Err.Number = 0
'the user exists
Else
'they don't
End If
--
Joan Wild
Microsoft Access MVP


.
 
Back
Top