Senin, 11 Februari 2013

Re: [MS_AccessPros] Re: Seeing users that have a database open

Thanks I will try and see what I can get done, thanks

On Mon, Feb 11, 2013 at 9:05 AM, Bill Mosca <wrmosca@comcast.net> wrote:

> **
>
>
> Kickerpark8 (Your name?)
>
> The locking file for 2007-2010 file format has the extension .LACCDB. But
> that won't bve of much use since the User Level Security is not supported
> with the new accdb files. There are a couple of common ways to get the
> windows user name.
>
> Public Enum ObjectProp
> USER_NAME
> PC_NAME
> DOMAIN_NAME
> End Enum
>
> Public Function GetUserInfo_Script(lngProperty) As String
> 'Purpose : Get User and computer info using Scripting DLL.
> 'DateTime : 10/25/2004 06:56
> 'Author : Bill Mosca
> Dim objNet As Object
>
> Set objNet = CreateObject("wscript.network")
>
> Select Case lngProperty
> Case ObjectProp.USER_NAME
> GetUserInfo_Script = objNet.UserName
> Case ObjectProp.DOMAIN_NAME
> GetUserInfo_Script = objNet.UserDomain
> Case ObjectProp.PC_NAME
> GetUserInfo_Script = objNet.ComputerName
> End Select
>
> Set objNet = Nothing
>
> End Function
>
> - or -
>
> Private Declare Function GetUserName Lib "advapi32.dll" Alias
> "GetUserNameA" _
> (ByVal lpBuffer As String, nSize As Long) As Long
>
> Public Function CurrentUserName() As String
> 'Purpose : Returns the network login name
> 'DateTime : 5/28/2002 09:54
> 'Author : Bill Mosca
> Dim lngLen As Long
> Dim x As Long
> Dim strUserName As String
>
> 'Create buffer
> strUserName = String(254, Chr$(0))
> lngLen = Len(strUserName)
> x = GetUserName(strUserName, lngLen)
>
> If (x > 0) Then
> 'Trucate remaining buffer space from end of string.
> CurrentUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
> Else
> CurrentUserName = vbNullString
> End If
>
> End Function
>
> Regards,
> Bill Mosca, Founder - MS_Access_Professionals
> http://www.thatlldoit.com
> Microsoft Office Access MVP
>
> https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
> My nothing-to-do-with-Access blog
> http://wrmosca.wordpress.com
>
>
> --- In MS_Access_Professionals@yahoogroups.com, "kickerparks8" wrote:
> >
> > I have a database that has a range of management users that can log in
> and run reports or update information, but I need something to see which
> users are in the database, in older versions there was a .ldb viewer that
> would show me user names but it doesn't work on 2007 since the file
> extensions have changed to .accdb
> >
> > Any help would be great. thanks
> >
>
>
>


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)

<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar