By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

How to tell if others are connected to the database

P: n/a
Hello,

I'm trying to find a way to see who or how many connections, (or both) are
open on a single access database.

What I'm trying to do is find out who is logged in and hopefully
automatically send them a message if they are needed out of hte database, or
at least so I know who to talk to if there is a connection to the database.

If there isn't a way to find out who, then at least if I can find out how
many, I won't get so aggrevated when I find a user in the database, shut
them down, go back to my desk only to find another user is connected...etc.

Any help would be appreciated.

Thanks!
Jo
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Assuming Access 2000 or later, take a look at:
http://support.microsoft.com/?id=198755

Example:

Function ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long

cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=C:\Northwind2003.mdb"

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(adSchemaProviderSpecific, ,
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, "",
rs.Fields(2).Name, rs.Fields(3).Name

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jozef" <NO****@NOSPAM.com> wrote in message
news:MeNpe.1606504$8l.792687@pd7tw1no...

I'm trying to find a way to see who or how many connections, (or both)
are open on a single access database.

What I'm trying to do is find out who is logged in and hopefully
automatically send them a message if they are needed out of hte database,
or at least so I know who to talk to if there is a connection to the
database.

If there isn't a way to find out who, then at least if I can find out how
many, I won't get so aggrevated when I find a user in the database, shut
them down, go back to my desk only to find another user is
connected...etc.

Any help would be appreciated.

Thanks!
Jo

Nov 13 '05 #2

P: n/a
Thanks Allen!

That should help out alot.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
Assuming Access 2000 or later, take a look at:
http://support.microsoft.com/?id=198755

Example:

Function ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long

cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=C:\Northwind2003.mdb"

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(adSchemaProviderSpecific, ,
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, "",
rs.Fields(2).Name, rs.Fields(3).Name

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jozef" <NO****@NOSPAM.com> wrote in message
news:MeNpe.1606504$8l.792687@pd7tw1no...

I'm trying to find a way to see who or how many connections, (or both)
are open on a single access database.

What I'm trying to do is find out who is logged in and hopefully
automatically send them a message if they are needed out of hte database,
or at least so I know who to talk to if there is a connection to the
database.

If there isn't a way to find out who, then at least if I can find out how
many, I won't get so aggrevated when I find a user in the database, shut
them down, go back to my desk only to find another user is
connected...etc.

Any help would be appreciated.

Thanks!
Jo


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.