MUKESHY12390
Well-known Member
- Joined
- Sep 18, 2012
- Messages
- 901
- Office Version
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hi All,
I have list of "Computer Name", is there any method I can get "UserName" from it.
I get all this "Computer Name" through running below code. I'm trying to get userName while having below macro running OR after this process.
Any direct or indirect help would be appreciate.
thanks,
Mukesh Y
I have list of "Computer Name", is there any method I can get "UserName" from it.
I get all this "Computer Name" through running below code. I'm trying to get userName while having below macro running OR after this process.
Any direct or indirect help would be appreciate.
Code:
Public Sub Current_UserList_MSAccess(oConn As ADODB.Connection)
Dim rs As ADODB.Recordset
Set rs = oConn.OpenSchema(adSchemaProviderSpecific, , _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, rs.Fields(2).Name, rs.Fields(3).Name
Do Until rs.EOF
If Not (rs.BOF And rs.EOF) Then
' Debug.Print rs.GetString
Debug.Print rs.Fields(0), rs.Fields(1), rs.Fields(2), rs.Fields(3)
End If
rs.MoveNext
Loop
rs.Close
End Sub
Sub test()
Call Current_UserList_MSAccess(CurrentProject.Connection)
End Sub
thanks,
Mukesh Y