473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to tell if others are connected to the database

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
2 10526
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Simon Wigzell | last post by:
You'd think this would be the most basic sql query in the world but noooooo! I've tried this: on error resume next strsql = "SELECT * FROM " & session("TablePrefix") & CurrentTable SET rs =...
7
by: John | last post by:
I am having problems with special characters with database calls (if I'm referring to this in the right way). the problem is with apostrophes of all things. If an end user puts an apostrophe in...
5
by: Gregor Kovač | last post by:
Hi! How can I determine the name of a database I'm connected to. I tried the SNAP_GET_DB, SNAPSHOT_DATABASE, ... but all these return all databases that are defined as "Indirect" or "Home" in...
14
by: kenfar | last post by:
I'd like our daily quality & policy testing framework to also test if our databases are activated. However, I haven't found a good way to do this yet - every approach has issues: 1. get...
6
by: Guy Cohen | last post by:
Hi all. What is the use of this window? Is it only to see the objects/tables of the database? Lets say I have this code: Dim SQL As String SQL = "SELECT * from mytable"
5
by: jonathanlim | last post by:
I am trying to append data to my local access database from an oracle connected database. I tried using the default query function but it take a very long time and it sort of hangs there and no...
3
by: janita | last post by:
Hi i need to update a database which is connected to a form in visual basic. the entries that made in text boxes present in the form must be updated to the connected database. Can u help me with a...
3
by: navda | last post by:
hi ... i want the solution for this question please help me out. i have created a database in microsoft access database 2003 .the name of my database is information and i have...
0
by: Akinyemi | last post by:
Connecting to Database Table in the Embedded JavaDB in NetBeans Hi, I am trying to see if I can be using the Embedded Database that is, JavaDB in NetBeans to develop my Java Desktop Applications. ...
9
by: Moah Scout | last post by:
Hi all! I have a database which is connected to another db by ODBC Connection string via VBA. What I want is to have those tables succesfully connected through ODBC be accessible in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
0
BarryA
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...
1
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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.