How in code can I determine if the current front end .mdb file is being used by more than one person?
Can I determine how many people?
Can I determine who?
Can I determine who and how many are using a back end .mdb file?
Thanks in advance for sharing your experience.
The following code will generate a Listing (Debug Window) of currently Logged-On Users along with their Computer Names by using the OpenSchema() Method of the ADO Connection Object. You may also wish to view the supplied Link which contains similar code: - Const conUsers = "{947bb102-5d43-11d1-bdbf-00c04fb92675}"
-
-
Dim cnn As ADODB.Connection
-
Dim fld As ADODB.Field
-
Dim strUser As String
-
Dim rst As ADODB.Recordset
-
Dim varValue As Variant
-
-
Set cnn = CurrentProject.Connection
-
Set rst = cnn.OpenSchema(Schema:=adSchemaProviderSpecific, SchemaID:=conUsers)
-
-
'Set Heading
-
Debug.Print "Computer,UserName"
-
-
With rst 'fills Recordset (rst) with User List data
-
Do Until .EOF
-
intUser = intUser + 1
-
For Each fld In .Fields
-
If fld.Name = "COMPUTER_NAME" Or fld.Name = "LOGIN_NAME" Then
-
varValue = fld.Value
-
'Some of the return values are Null-Terminated Strings, if
-
'so strip them off
-
If InStr(varValue, vbNullChar) > 0 Then
-
varValue = Left(varValue, InStr(varValue, vbNullChar) - 1)
-
End If
-
strUser = strUser & varValue & ","
-
End If
-
Next
-
Debug.Print Left$(strUser, Len(strUser) - 1)
-
strUser = "" 'Reset
-
.MoveNext
-
Loop
-
End With
-
-
'Routine cleanup chores
-
Set fld = Nothing
-
Set rst = Nothing
-
Set cnn = Nothing
OUTPUT (Single User): - Computer,UserName
-
DEZII,Admin
http://bytes.com/topic/access/insigh...rate-user-list 2 2046
The following code will generate a Listing (Debug Window) of currently Logged-On Users along with their Computer Names by using the OpenSchema() Method of the ADO Connection Object. You may also wish to view the supplied Link which contains similar code: - Const conUsers = "{947bb102-5d43-11d1-bdbf-00c04fb92675}"
-
-
Dim cnn As ADODB.Connection
-
Dim fld As ADODB.Field
-
Dim strUser As String
-
Dim rst As ADODB.Recordset
-
Dim varValue As Variant
-
-
Set cnn = CurrentProject.Connection
-
Set rst = cnn.OpenSchema(Schema:=adSchemaProviderSpecific, SchemaID:=conUsers)
-
-
'Set Heading
-
Debug.Print "Computer,UserName"
-
-
With rst 'fills Recordset (rst) with User List data
-
Do Until .EOF
-
intUser = intUser + 1
-
For Each fld In .Fields
-
If fld.Name = "COMPUTER_NAME" Or fld.Name = "LOGIN_NAME" Then
-
varValue = fld.Value
-
'Some of the return values are Null-Terminated Strings, if
-
'so strip them off
-
If InStr(varValue, vbNullChar) > 0 Then
-
varValue = Left(varValue, InStr(varValue, vbNullChar) - 1)
-
End If
-
strUser = strUser & varValue & ","
-
End If
-
Next
-
Debug.Print Left$(strUser, Len(strUser) - 1)
-
strUser = "" 'Reset
-
.MoveNext
-
Loop
-
End With
-
-
'Routine cleanup chores
-
Set fld = Nothing
-
Set rst = Nothing
-
Set cnn = Nothing
OUTPUT (Single User): - Computer,UserName
-
DEZII,Admin
http://bytes.com/topic/access/insigh...rate-user-list Sign in to post your reply or Sign up for a free account.
Similar topics
by: mike420 |
last post by:
In the context of LATEX, some Pythonista asked what the big
successes of Lisp were. I think there were at least three *big*
successes.
a. orbitz.com web site uses Lisp for algorithms, etc.
b....
|
by: Mike MacSween |
last post by:
S**t for brains strikes again!
Why did I do that? When I met the clients and at some point they vaguely
asked whether eventually would it be possible to have some people who could
read the data...
|
by: Corne' Cornelius |
last post by:
Hi,
When you open a file for writing/appending with open() or fopen(), and
you have multiple applications that might want to write to the same file
at the same time, could that cause weirdness...
|
by: Arjen |
last post by:
Hello,
I have made a little test application and needs some help.
I have two classes with hash tables which I want to serialize inside one xml
file.
My question is if someone can make the...
|
by: Arjen |
last post by:
Hello,
I have made a little test application and needs some help.
I have two classes with hash tables which I want to serialize inside one xml
file.
My question is if someone can make the...
|
by: Jiho Han |
last post by:
Here's the issue.
You have a class,
Class Person
{
public int id;
public string firstname;
public string lastname;
}
|
by: shilpa.saraogi |
last post by:
Heya all,
How do I tell, prgrammatically, if a file is opened for read/write by
some other process? In unix .. of course.
My program needs to open files and work on it, and I want it to make...
|
by: salad |
last post by:
XML seems to be a hot technology buzzword. And it appears XML is
supported in A2003.
I am wondering if it could be used in the following scenario. I create
an order record for the customer. ...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |