A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Who is using the database?



 
 
Thread Tools Display Modes
  #1  
Old March 20th, 2007, 11:41 AM posted to microsoft.public.access.tablesdbdesign
Jock W
external usenet poster
 
Posts: 21
Default Who is using the database?

How can I ascertain whom, on a network, is accessing the Access database?
On one form, I have a text box which displays who printed the form using
"=fOSUserName()", so I am wondering if I can use a similar expression in a
form or report to show me who is accessing the database because I am fed up
of the "You do not have exclusive access to the database at this time......"
warning.
:-/
Thanks
--
Jock Waddington
  #2  
Old March 20th, 2007, 12:35 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Who is using the database?

Unless the database is opened exclusively, the LDB file will tell you who is
connected. Sample code:
http://allenbrowne.com/func-ADO.html...rMultipleUsers

But this issue can arise even if no other users are in the db. It seems to
occur if you modify the object (the form or report or its module), use it,
and go to save it after making other changes.

--
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.

"Jock W" wrote in message
...
How can I ascertain whom, on a network, is accessing the Access database?
On one form, I have a text box which displays who printed the form using
"=fOSUserName()", so I am wondering if I can use a similar expression in a
form or report to show me who is accessing the database because I am fed
up
of the "You do not have exclusive access to the database at this
time......"
warning.
:-/
Thanks
--
Jock Waddington


  #3  
Old March 20th, 2007, 02:42 PM posted to microsoft.public.access.tablesdbdesign
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Who is using the database?

"Allen Browne" wrote in
:

Unless the database is opened exclusively, the LDB file will tell
you who is connected. Sample code:
http://allenbrowne.com/func-ADO.html...erMultipleUser
s


I have been working with the old msldbusr.dll for nearly a decade
now, and recently implemented the ADO UserRoster for the first time.
It seems to give different results, and seems to be getting data out
of the MDB file itself instead of just from the LDB file.

I just revived an old administrative database for the possible use
of one of my clients and you can download it he

http://dfenton.com/DFA/download/Access/Admin.zip

It's an A2K database, and it uses late binding for ADO.

I did not need the complicated code you have, Allen, to get the
number of users.

I found that the msldbusr.dll code was much easier to work with (it
returns a much more versatile data structure), even though the
basics for UserRoster look really easy. The problem is that if you
want to filter the results you can't, because you don't have access
to the field names so you can query the UserRoster with WHERE
clauses. I found this to be a real lack.

Anyway, the above database has a UserRoster implementation in its
main "Who's logged on?" form, and also has two alternate approaches
that don't use UserRoster. One uses the old msldbusr.dll, which was
for Jet 3.5. But most of its functionality works just fine with Jet
4 (it can't do the suspect users lookup, though; or, at least, I
haven't figured out how to make it work). The other form just opens
the LDB file with basic I/O functions and eads it directly. This
doesn't give you as much information about the states, but can work
in some situations where msldbusr.dll will not.

Feedback and suggestions welcome -- it really was a very
quick-and-dirty conversion of code that I wrote in 1998! And it was
my first use of the ADO UserRoster.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #4  
Old March 20th, 2007, 04:27 PM posted to microsoft.public.access.tablesdbdesign
Jock W
external usenet poster
 
Posts: 21
Default Who is using the database?

Allen,
thanks for that, but where would I put this code? in a form or report?
I am not as advanced as some users but am willing to try anything if I can
understand the concept!
tia
--
Jock Waddington


"Allen Browne" wrote:

Unless the database is opened exclusively, the LDB file will tell you who is
connected. Sample code:
http://allenbrowne.com/func-ADO.html...rMultipleUsers

But this issue can arise even if no other users are in the db. It seems to
occur if you modify the object (the form or report or its module), use it,
and go to save it after making other changes.

--
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.

"Jock W" wrote in message
...
How can I ascertain whom, on a network, is accessing the Access database?
On one form, I have a text box which displays who printed the form using
"=fOSUserName()", so I am wondering if I can use a similar expression in a
form or report to show me who is accessing the database because I am fed
up
of the "You do not have exclusive access to the database at this
time......"
warning.
:-/
Thanks
--
Jock Waddington



  #5  
Old March 20th, 2007, 11:21 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Who is using the database?

The code goes into a standard module.
Click the Modules tab of the Database window.
Click New, and paste the code in there.
In the code window, choose Compile on the Debug menu.
If there are errors, you may need to add the ADO reference:
http://allenbrowne.com/ser-38.html

You can then use the function just like Date() or any of the built-in ones.
One way is to open the Immediate Window (Ctrl+G), and enter:
? ShowUserRosterMultipleUsers()

--
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.

"Jock W" wrote in message
...
Allen,
thanks for that, but where would I put this code? in a form or report?
I am not as advanced as some users but am willing to try anything if I can
understand the concept!
tia
--
Jock Waddington


"Allen Browne" wrote:

Unless the database is opened exclusively, the LDB file will tell you who
is
connected. Sample code:
http://allenbrowne.com/func-ADO.html...rMultipleUsers

But this issue can arise even if no other users are in the db. It seems
to
occur if you modify the object (the form or report or its module), use
it,
and go to save it after making other changes.

"Jock W" wrote in message
...
How can I ascertain whom, on a network, is accessing the Access
database?
On one form, I have a text box which displays who printed the form
using
"=fOSUserName()", so I am wondering if I can use a similar expression
in a
form or report to show me who is accessing the database because I am
fed
up
of the "You do not have exclusive access to the database at this
time......"
warning.
:-/
Thanks
--
Jock Waddington


  #6  
Old March 20th, 2007, 11:25 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Who is using the database?

Hi David. It's been ages since I fiddled with this, but my recollection is
that the LDB may not be up to date (i.e. it retains info on users who have
logged out), so the newer approach is more useful.

As always, we would love to hear from anyone who uses these regularly.

--
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.

"David W. Fenton" wrote in message
. 1...
"Allen Browne" wrote in
:

Unless the database is opened exclusively, the LDB file will tell
you who is connected. Sample code:
http://allenbrowne.com/func-ADO.html...erMultipleUser
s


I have been working with the old msldbusr.dll for nearly a decade
now, and recently implemented the ADO UserRoster for the first time.
It seems to give different results, and seems to be getting data out
of the MDB file itself instead of just from the LDB file.

I just revived an old administrative database for the possible use
of one of my clients and you can download it he

http://dfenton.com/DFA/download/Access/Admin.zip

It's an A2K database, and it uses late binding for ADO.

I did not need the complicated code you have, Allen, to get the
number of users.

I found that the msldbusr.dll code was much easier to work with (it
returns a much more versatile data structure), even though the
basics for UserRoster look really easy. The problem is that if you
want to filter the results you can't, because you don't have access
to the field names so you can query the UserRoster with WHERE
clauses. I found this to be a real lack.

Anyway, the above database has a UserRoster implementation in its
main "Who's logged on?" form, and also has two alternate approaches
that don't use UserRoster. One uses the old msldbusr.dll, which was
for Jet 3.5. But most of its functionality works just fine with Jet
4 (it can't do the suspect users lookup, though; or, at least, I
haven't figured out how to make it work). The other form just opens
the LDB file with basic I/O functions and eads it directly. This
doesn't give you as much information about the states, but can work
in some situations where msldbusr.dll will not.

Feedback and suggestions welcome -- it really was a very
quick-and-dirty conversion of code that I wrote in 1998! And it was
my first use of the ADO UserRoster.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/


  #7  
Old March 21st, 2007, 08:28 AM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Who is using the database?

On Mar 20, 2:42 pm, "David W. Fenton"
wrote:
The problem is that if you
want to filter the results you can't, because you don't have access
to the field names so you can query the UserRoster with WHERE
clauses.


With UserRoster, the data structure is an ADODB.Recordset, therefore
you can use its Filter method e.g.

rs.Filter = "LOGIN_NAME LIKE 'Jamie%' AND CONNECTED = True"

For more details on the Filter property, see:

http://msdn.microsoft.com/library/de...dprofilter.asp

Jamie.

--


  #8  
Old March 21st, 2007, 09:08 AM posted to microsoft.public.access.tablesdbdesign
Jock W
external usenet poster
 
Posts: 21
Default Who is using the database?

Ok, getting somewhere now.
Set up the module as stated. Added a text box to the switchboard and made
the control "=ShowUserRosterMultipleUsers()".
When executing, I get a run time error stating I don't have the necessary
permissions to use the *****.mdb object. I have full rights so I am a bit
bewildered by this message. Also, I don't understand the bit about needing a
GUI to reference the schema.
Help and thanks for your patience - it's much appreciated
regards
--
Jock Waddington


"Allen Browne" wrote:

The code goes into a standard module.
Click the Modules tab of the Database window.
Click New, and paste the code in there.
In the code window, choose Compile on the Debug menu.
If there are errors, you may need to add the ADO reference:
http://allenbrowne.com/ser-38.html

You can then use the function just like Date() or any of the built-in ones.
One way is to open the Immediate Window (Ctrl+G), and enter:
? ShowUserRosterMultipleUsers()

--
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.

"Jock W" wrote in message
...
Allen,
thanks for that, but where would I put this code? in a form or report?
I am not as advanced as some users but am willing to try anything if I can
understand the concept!
tia
--
Jock Waddington


"Allen Browne" wrote:

Unless the database is opened exclusively, the LDB file will tell you who
is
connected. Sample code:
http://allenbrowne.com/func-ADO.html...rMultipleUsers

But this issue can arise even if no other users are in the db. It seems
to
occur if you modify the object (the form or report or its module), use
it,
and go to save it after making other changes.

"Jock W" wrote in message
...
How can I ascertain whom, on a network, is accessing the Access
database?
On one form, I have a text box which displays who printed the form
using
"=fOSUserName()", so I am wondering if I can use a similar expression
in a
form or report to show me who is accessing the database because I am
fed
up
of the "You do not have exclusive access to the database at this
time......"
warning.
:-/
Thanks
--
Jock Waddington



  #9  
Old March 21st, 2007, 09:22 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Who is using the database?

If the database is secured (MDW file), you may need to include the security
info as part of the Open string.

I'm not sure what was meant by "needing a GUI" either. Not sure what you are
referring to here.

--
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.

"Jock W" wrote in message
...
Ok, getting somewhere now.
Set up the module as stated. Added a text box to the switchboard and made
the control "=ShowUserRosterMultipleUsers()".
When executing, I get a run time error stating I don't have the necessary
permissions to use the *****.mdb object. I have full rights so I am a bit
bewildered by this message. Also, I don't understand the bit about needing
a
GUI to reference the schema.
Help and thanks for your patience - it's much appreciated
regards
--
Jock Waddington


"Allen Browne" wrote:

The code goes into a standard module.
Click the Modules tab of the Database window.
Click New, and paste the code in there.
In the code window, choose Compile on the Debug menu.
If there are errors, you may need to add the ADO reference:
http://allenbrowne.com/ser-38.html

You can then use the function just like Date() or any of the built-in
ones.
One way is to open the Immediate Window (Ctrl+G), and enter:
? ShowUserRosterMultipleUsers()

"Jock W" wrote in message
...
Allen,
thanks for that, but where would I put this code? in a form or report?
I am not as advanced as some users but am willing to try anything if I
can
understand the concept!
tia
--
Jock Waddington


"Allen Browne" wrote:

Unless the database is opened exclusively, the LDB file will tell you
who
is
connected. Sample code:
http://allenbrowne.com/func-ADO.html...rMultipleUsers

But this issue can arise even if no other users are in the db. It
seems
to
occur if you modify the object (the form or report or its module), use
it,
and go to save it after making other changes.

"Jock W" wrote in message
...
How can I ascertain whom, on a network, is accessing the Access
database?
On one form, I have a text box which displays who printed the form
using
"=fOSUserName()", so I am wondering if I can use a similar
expression
in a
form or report to show me who is accessing the database because I am
fed
up
of the "You do not have exclusive access to the database at this
time......"
warning.
:-/
Thanks
--
Jock Waddington


  #10  
Old March 21st, 2007, 09:37 AM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Who is using the database?

On Mar 20, 2:42 pm, "David W. Fenton"
wrote:
Feedback and suggestions welcome -- it really was a very
quick-and-dirty conversion of code that I wrote in 1998! And it was
my first use of the ADO UserRoster.


FWIW Granny Spitz, former group regular (but now residing in the Where
Are they Now? file) didn't think too highly of this approach and
preferred a more 'manual' (but IMO less reliable) approach.

See:

http://groups.google.com/group/micro...cfc04264b4ec2a

Jamie.

--


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.