|
Home > Archive > MS Access Multiuser > September 2005 > table or form open by another user on different PC
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
table or form open by another user on different PC
|
|
| John B via AccessMonster.com 2005-09-15, 3:25 am |
| How do you determine if a table or a form is open by another user on a
different PC? I assume there must be some VB code for this?
Some additional details: I have a database on a network drive used by a few
users. There is one function of the database that I only want one person at
a time to use. This function is associated with a specific form and table.
I haven't figured out how to test the form or table to see if another user
has either one of them open.
Thanks in advance for any help!
| |
| Alex Dybenko 2005-09-15, 9:24 am |
| Hi,
you can try to open this table in locked mode - if this fail - then table
already opened
--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"John B via webservertalk.com" <forum@webservertalk.com> wrote in message
news:5461FE7D4483F@w
ebservertalk.com...
> How do you determine if a table or a form is open by another user on a
> different PC? I assume there must be some VB code for this?
>
> Some additional details: I have a database on a network drive used by a
> few
> users. There is one function of the database that I only want one person
> at
> a time to use. This function is associated with a specific form and
> table.
> I haven't figured out how to test the form or table to see if another user
> has either one of them open.
>
> Thanks in advance for any help!
| |
| John B via AccessMonster.com 2005-09-15, 9:24 am |
| Thanks Alex. This sounds reasonable. Can you assist with the command to
open a table in locked mode?
Alex Dybenko wrote:[color=darkred
]
>Hi,
>you can try to open this table in locked mode - if this fail - then table
>already opened
>
>[quoted text clipped - 9 lines]
--
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Fo...tiuser/200509/1
| |
| Alex Dybenko 2005-09-15, 8:25 pm |
| Hi,
for example like this:
set rst =currentdb.OpenRecordset("Table1" ,dbOpenTable,dbDenyR
ead)
--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"John B via webservertalk.com" <forum@webservertalk.com> wrote in message
news:54674D6B755E5@w
ebservertalk.com...
> Thanks Alex. This sounds reasonable. Can you assist with the command to
> open a table in locked mode?
>
> Alex Dybenko wrote:
>
>
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Fo...tiuser/200509/1
| |
| John B via AccessMonster.com 2005-09-15, 8:25 pm |
| Hi Alex,
So, when the first person tries to execute the command you supplied, the
table will open OK and the DenyRead will be applied. Then, when the second
person tries to execute that command it will fail?
Will I have to Close the table myself with a similar VB command when the
first person is done with it?
Just trying to better understand the process. Thanks for your time!
Alex Dybenko wrote:[color=darkred
]
>Hi,
>for example like this:
>
>set rst =currentdb.OpenRecordset("Table1" ,dbOpenTable,dbDenyR
ead)
>
>[quoted text clipped - 8 lines]
--
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Fo...tiuser/200509/1
| |
| Alex Dybenko 2005-09-15, 8:25 pm |
| Hi,
as i understand your question:
How do you determine if a table or a form is open by another user on a
different PC? I assume there must be some VB code for this?
so in order to determine this - you run this code:
on error resume next
set rst =currentdb.OpenRecordset("Table1" ,dbOpenTable,dbDenyR
ead)
if err.number <> 0 then
'Table already opened!
end if
rst.close
so you can replace 'Table already opened! with you code, when table is
already opened
HTH
--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"John B via webservertalk.com" <forum@webservertalk.com> wrote in message
news:546AB5054D239@w
ebservertalk.com...
> Hi Alex,
> So, when the first person tries to execute the command you supplied, the
> table will open OK and the DenyRead will be applied. Then, when the
> second
> person tries to execute that command it will fail?
>
> Will I have to Close the table myself with a similar VB command when the
> first person is done with it?
>
> Just trying to better understand the process. Thanks for your time!
>
> Alex Dybenko wrote:
>
>
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Fo...tiuser/200509/1
| |
| John B via AccessMonster.com 2005-09-15, 8:25 pm |
| Alex,
You understood the question perfectly and supplied a perfect solution. How
easy the answer always seems when you finally know it!
Appreciate your help a lot!
John
Alex Dybenko wrote:[color=darkred
]
>Hi,
>as i understand your question:
>
>How do you determine if a table or a form is open by another user on a
>different PC? I assume there must be some VB code for this?
>
>so in order to determine this - you run this code:
>
>on error resume next
>set rst =currentdb.OpenRecordset("Table1" ,dbOpenTable,dbDenyR
ead)
>if err.number <> 0 then
> 'Table already opened!
>end if
>rst.close
>
>so you can replace 'Table already opened! with you code, when table is
>already opened
>
>HTH
>[quoted text clipped - 18 lines]
--
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Fo...tiuser/200509/1
|
|
|
|
|