Ask a Question related to ASP Database, Design and Development.
-
Patrick #1
Access + Asp + multiuser + table lock
Hi all.
In my asp site, i have a "Search and Sort" button that creates a lot of
activity in my access database.
Clciking on the button does that :
1. Begin a transaction
2. Create duplicates of empty model tables : "SELECT * INTO DuplicateTable
FROM ModelTable". Of course DuplicateTable is a unique name.
3. Use lot of "conn.execute sqlstring" instructions to add/delete/update in
the duplicate tables
4. Destroy duplicate tables
5. Close transaction
Plz don't ask why i create duplicate tables as i've tried many different
solutions : this one is the closest to what i want.
(if you want precisions on the other solutions i tried, i wrote a post in
microsoft.public.access.multiuser called Asp Multiuser and table lock)
It works fine until two users click the "Search and Sort" button at the very
same time
In this case, the second user get an error message when creating duplicate
tables (Step 2).
It says something about a lock that i don't know how to translate. Error
number is 80004005.
Why is there a lock here ? I don't open any recordset that involves the
tables concerned by Step 2 !
Any advice welcome
Patrick Guest
-
Which (table) lock mode to use
Hi I have this scenario and would like to use lock table for this but I don't know which mode I should use. When I delete/update/insert a... -
Access multiuser / transactions / asp
Hi all I'm getting this error message : The table "MyTable" is already opened exclusively by another user or it is already open throught the... -
Going from multiuser to single-user back to multiuser
Yesterday I had occasion to bring our 5.0.7 system down to single-user mode using shutdown -g0 su . When done with my maintenance, I exited... -
Transactions and Table Lock
Jacco, thanks a lot for your suggestions. I'll try to keep it in mind ;) Seize the Day Andy ------------------------------ Andreas Bretl... -
Lock a table
I have the following situation create proc test truncate table A IF C=B BEGIN insert into table #B .... .... -
Jeff Cochran #2
Re: Access + Asp + multiuser + table lock
On Thu, 15 Apr 2004 21:32:04 +0200, "Patrick" <xxx@xxx.xxx> wrote:
See:>Hi all.
>
>In my asp site, i have a "Search and Sort" button that creates a lot of
>activity in my access database.
>
>Clciking on the button does that :
>1. Begin a transaction
>2. Create duplicates of empty model tables : "SELECT * INTO DuplicateTable
>FROM ModelTable". Of course DuplicateTable is a unique name.
>3. Use lot of "conn.execute sqlstring" instructions to add/delete/update in
>the duplicate tables
>4. Destroy duplicate tables
>5. Close transaction
>
>Plz don't ask why i create duplicate tables as i've tried many different
>solutions : this one is the closest to what i want.
>(if you want precisions on the other solutions i tried, i wrote a post in
>microsoft.public.access.multiuser called Asp Multiuser and table lock)
>
>It works fine until two users click the "Search and Sort" button at the very
>same time
>In this case, the second user get an error message when creating duplicate
>tables (Step 2).
>It says something about a lock that i don't know how to translate. Error
>number is 80004005.
Why do I get database-related 80004005 errors?
[url]http://www.aspfaq.com/show.asp?id=2009[/url]
Most importantly, see:>Why is there a lock here ? I don't open any recordset that involves the
>tables concerned by Step 2 !
>Any advice welcome
What are the limitations of Access?
[url]http://www.aspfaq.com/show.asp?id=2195[/url]
Jeff
Jeff Cochran Guest
-
Patrick #3
Re: Access + Asp + multiuser + table lock
Thanks for the links Jeff, but i already spent a lot of time on this and i
can't find a solution or even an explanation to my problem.
"Jeff Cochran" <jcochran.nospam@naplesgov.com> a écrit dans le message de
news:407ef0bf.27856585@msnews.microsoft.com...DuplicateTable> On Thu, 15 Apr 2004 21:32:04 +0200, "Patrick" <xxx@xxx.xxx> wrote:
>> >Hi all.
> >
> >In my asp site, i have a "Search and Sort" button that creates a lot of
> >activity in my access database.
> >
> >Clciking on the button does that :
> >1. Begin a transaction
> >2. Create duplicates of empty model tables : "SELECT * INTOin> >FROM ModelTable". Of course DuplicateTable is a unique name.
> >3. Use lot of "conn.execute sqlstring" instructions to add/delete/updatevery> >the duplicate tables
> >4. Destroy duplicate tables
> >5. Close transaction
> >
> >Plz don't ask why i create duplicate tables as i've tried many different
> >solutions : this one is the closest to what i want.
> >(if you want precisions on the other solutions i tried, i wrote a post in
> >microsoft.public.access.multiuser called Asp Multiuser and table lock)
> >
> >It works fine until two users click the "Search and Sort" button at theduplicate> >same time
> >In this case, the second user get an error message when creating>> >tables (Step 2).
> >It says something about a lock that i don't know how to translate. Error
> >number is 80004005.
> See:
>
> Why do I get database-related 80004005 errors?
> [url]http://www.aspfaq.com/show.asp?id=2009[/url]
>>> >Why is there a lock here ? I don't open any recordset that involves the
> >tables concerned by Step 2 !
> >Any advice welcome
> Most importantly, see:
>
> What are the limitations of Access?
> [url]http://www.aspfaq.com/show.asp?id=2195[/url]
>
> Jeff
Patrick Guest
-
Jeff Cochran #4
Re: Access + Asp + multiuser + table lock
On Thu, 15 Apr 2004 23:16:34 +0200, "Patrick" <xxx@xxx.xxx> wrote:
It's hard to tell without knowing the exact error, but my first guess>Thanks for the links Jeff, but i already spent a lot of time on this and i
>can't find a solution or even an explanation to my problem.
was the recordset is being held open while you perform your
transactions, thus locking the file for the next user or process.
Keeping connections short would help this, but a select into another
table just may keep the file locked for too long. My second thought
is that the file really is locked, and Access is poor for dealing with
multiple users. A switch to MSDE might help that.
Jeff
>
>"Jeff Cochran" <jcochran.nospam@naplesgov.com> a écrit dans le message de
>news:407ef0bf.27856585@msnews.microsoft.com...>DuplicateTable>> On Thu, 15 Apr 2004 21:32:04 +0200, "Patrick" <xxx@xxx.xxx> wrote:
>>>> >Hi all.
>> >
>> >In my asp site, i have a "Search and Sort" button that creates a lot of
>> >activity in my access database.
>> >
>> >Clciking on the button does that :
>> >1. Begin a transaction
>> >2. Create duplicates of empty model tables : "SELECT * INTO>in>> >FROM ModelTable". Of course DuplicateTable is a unique name.
>> >3. Use lot of "conn.execute sqlstring" instructions to add/delete/update>very>> >the duplicate tables
>> >4. Destroy duplicate tables
>> >5. Close transaction
>> >
>> >Plz don't ask why i create duplicate tables as i've tried many different
>> >solutions : this one is the closest to what i want.
>> >(if you want precisions on the other solutions i tried, i wrote a post in
>> >microsoft.public.access.multiuser called Asp Multiuser and table lock)
>> >
>> >It works fine until two users click the "Search and Sort" button at the>duplicate>> >same time
>> >In this case, the second user get an error message when creating>>>>> >tables (Step 2).
>> >It says something about a lock that i don't know how to translate. Error
>> >number is 80004005.
>> See:
>>
>> Why do I get database-related 80004005 errors?
>> [url]http://www.aspfaq.com/show.asp?id=2009[/url]
>>>>>> >Why is there a lock here ? I don't open any recordset that involves the
>> >tables concerned by Step 2 !
>> >Any advice welcome
>> Most importantly, see:
>>
>> What are the limitations of Access?
>> [url]http://www.aspfaq.com/show.asp?id=2195[/url]
>>
>> JeffJeff Cochran Guest
-
Patrick #5
Re: Access + Asp + multiuser + table lock
I don't understand anything to these locks.
Why do i get a lock for a table that has no recordsets and no SQL query that
add/delete/update its rows ?
I tried some prvider specific settings, but nothing works :
Jet OLEDB:Database Locking Mode
Jet OLEDB:Lock Delay
Jet OLEDB:Lock Retry
Jet OLEDB:Max Locks Per File
Jet OLEDB:Locking Granularity
I hate not knowing the cause of a problem.
I'll do error handling for this, but error handling in ADO sucks and in my
cases makes both users wait a long time before getting the results on the
screen.
Next time I swear i'll use MSDE :-)
Patrick Guest
-
Larry Linson #6
Re: Access + Asp + multiuser + table lock
Strictly speaking, you are using a Jet database with your .asp pages, not an
"Access database" although we often use that "shorthand" and so does
Microsoft.
"Multiuser", in Access/Jet parlance, is a rather specific term... implying
an Access-Jet environment with multiple users logging in to the same MDB or
MDB front end with shared MDB back end.
There's more than one way to access a Jet database from .ASP, but the most
common one is that all accesses are with the same userid / password. That
can cause some confusion... because all the users are, to the ADO software /
Jet database, just one single user.
Your "duplicate tables" and the reasoning are rather vaguely described, but
likely the design of your database and application are the reason you are
having difficulties.
Larry Linson
Microsoft Access MVP
"Patrick" <xxx@xxx.xxx> wrote in message
news:O0CpNByIEHA.1412@TK2MSFTNGP12.phx.gbl...in> Hi all.
>
> In my asp site, i have a "Search and Sort" button that creates a lot of
> activity in my access database.
>
> Clciking on the button does that :
> 1. Begin a transaction
> 2. Create duplicates of empty model tables : "SELECT * INTO DuplicateTable
> FROM ModelTable". Of course DuplicateTable is a unique name.
> 3. Use lot of "conn.execute sqlstring" instructions to add/delete/updatevery> the duplicate tables
> 4. Destroy duplicate tables
> 5. Close transaction
>
> Plz don't ask why i create duplicate tables as i've tried many different
> solutions : this one is the closest to what i want.
> (if you want precisions on the other solutions i tried, i wrote a post in
> microsoft.public.access.multiuser called Asp Multiuser and table lock)
>
> It works fine until two users click the "Search and Sort" button at the> same time
> In this case, the second user get an error message when creating duplicate
> tables (Step 2).
> It says something about a lock that i don't know how to translate. Error
> number is 80004005.
>
> Why is there a lock here ? I don't open any recordset that involves the
> tables concerned by Step 2 !
> Any advice welcome
>
>
Larry Linson Guest
-
Patrick #7
Re: Access + Asp + multiuser + table lock
> "Multiuser", in Access/Jet parlance, is a rather specific term... implying
or> an Access-Jet environment with multiple users logging in to the same MDBRight> MDB front end with shared MDB back end.
/> There's more than one way to access a Jet database from .ASP, but the most
> common one is that all accesses are with the same userid / password. That
> can cause some confusion... because all the users are, to the ADO softwareThat is my case : User ID=admin> Jet database, just one single user.
but> Your "duplicate tables" and the reasoning are rather vaguely described,You may be right as i'm not very experienced. I'd be very pleased to discuss> likely the design of your database and application are the reason you are
> having difficulties.
of my app design in detail if you don't mind spending a lot of time on this.
But i'm still wondering why i get a lock error when trying to execute that
statement : "SELECT * INTO DuplicateTable
FROM ModelTable" knowing that :
- DuplicateTable doesn't exist yet
- ModelTable is used nowhere else in my app (no recordset opened, no SQL
statement executed, NOTHING)
DuplicateTable>
> Larry Linson
> Microsoft Access MVP
> "Patrick" <xxx@xxx.xxx> wrote in message
> news:O0CpNByIEHA.1412@TK2MSFTNGP12.phx.gbl...> > Hi all.
> >
> > In my asp site, i have a "Search and Sort" button that creates a lot of
> > activity in my access database.
> >
> > Clciking on the button does that :
> > 1. Begin a transaction
> > 2. Create duplicates of empty model tables : "SELECT * INTOin> in> > FROM ModelTable". Of course DuplicateTable is a unique name.
> > 3. Use lot of "conn.execute sqlstring" instructions to add/delete/update> > the duplicate tables
> > 4. Destroy duplicate tables
> > 5. Close transaction
> >
> > Plz don't ask why i create duplicate tables as i've tried many different
> > solutions : this one is the closest to what i want.
> > (if you want precisions on the other solutions i tried, i wrote a postduplicate> very> > microsoft.public.access.multiuser called Asp Multiuser and table lock)
> >
> > It works fine until two users click the "Search and Sort" button at the> > same time
> > In this case, the second user get an error message when creating>> > tables (Step 2).
> > It says something about a lock that i don't know how to translate. Error
> > number is 80004005.
> >
> > Why is there a lock here ? I don't open any recordset that involves the
> > tables concerned by Step 2 !
> > Any advice welcome
> >
> >
>
Patrick Guest
-
Jeff Cochran #8
Re: Access + Asp + multiuser + table lock
On Fri, 16 Apr 2004 03:47:53 +0200, "Patrick" <xxx@xxx.xxx> wrote:
Except on an Access, err, Jet, database, that can lock the MDB file>or>> "Multiuser", in Access/Jet parlance, is a rather specific term... implying
>> an Access-Jet environment with multiple users logging in to the same MDB>>> MDB front end with shared MDB back end.
>Right
>>/>> There's more than one way to access a Jet database from .ASP, but the most
>> common one is that all accesses are with the same userid / password. That
>> can cause some confusion... because all the users are, to the ADO software>>> Jet database, just one single user.
>That is my case : User ID=admin
>>but>> Your "duplicate tables" and the reasoning are rather vaguely described,>>> likely the design of your database and application are the reason you are
>> having difficulties.
>You may be right as i'm not very experienced. I'd be very pleased to discuss
>of my app design in detail if you don't mind spending a lot of time on this.
>
>But i'm still wondering why i get a lock error when trying to execute that
>statement : "SELECT * INTO DuplicateTable
>FROM ModelTable" knowing that :
>- DuplicateTable doesn't exist yet
>- ModelTable is used nowhere else in my app (no recordset opened, no SQL
>statement executed, NOTHING)
itself. Part of your problem may very well be the single user locking
of the database as Larry suggested. On the other hand, even with
multiple users Access, um, I mean Jet, databases have some locking
issues. You may see it in an ADO environment where you may not see it
elsewhere too.
Larry can probably go into better detail with the actual locking
levels, but you may need to redesign your database or move to a MSDE
or SQL Server database to keep from having these locking issues.
Jeff
>DuplicateTable>> Larry Linson
>> Microsoft Access MVP
>> "Patrick" <xxx@xxx.xxx> wrote in message
>> news:O0CpNByIEHA.1412@TK2MSFTNGP12.phx.gbl...>> > Hi all.
>> >
>> > In my asp site, i have a "Search and Sort" button that creates a lot of
>> > activity in my access database.
>> >
>> > Clciking on the button does that :
>> > 1. Begin a transaction
>> > 2. Create duplicates of empty model tables : "SELECT * INTO>in>> in>> > FROM ModelTable". Of course DuplicateTable is a unique name.
>> > 3. Use lot of "conn.execute sqlstring" instructions to add/delete/update>> > the duplicate tables
>> > 4. Destroy duplicate tables
>> > 5. Close transaction
>> >
>> > Plz don't ask why i create duplicate tables as i've tried many different
>> > solutions : this one is the closest to what i want.
>> > (if you want precisions on the other solutions i tried, i wrote a post>duplicate>> very>> > microsoft.public.access.multiuser called Asp Multiuser and table lock)
>> >
>> > It works fine until two users click the "Search and Sort" button at the>> > same time
>> > In this case, the second user get an error message when creating>>>>> > tables (Step 2).
>> > It says something about a lock that i don't know how to translate. Error
>> > number is 80004005.
>> >
>> > Why is there a lock here ? I don't open any recordset that involves the
>> > tables concerned by Step 2 !
>> > Any advice welcome
>> >
>> >
>>Jeff Cochran Guest
-
Patrick #9
Re: Access + Asp + multiuser + table lock
> Except on an Access, err, Jet, database, that can lock the MDB file
Thanks to take the time to answer me Jeff !> itself. Part of your problem may very well be the single user locking
> of the database as Larry suggested. On the other hand, even with
> multiple users Access, um, I mean Jet, databases have some locking
> issues. You may see it in an ADO environment where you may not see it
> elsewhere too.
>
> Larry can probably go into better detail with the actual locking
> levels, but you may need to redesign your database or move to a MSDE
> or SQL Server database to keep from having these locking issues.
I hope i won't have to redesign my app or change my database as i'm nearly
finished with it.
As I'm running out of time, i prefer put a friendly error message asking the
user to wait rather than redesigning the entire app !
But i don't like not knowing why things do not work !
Patrick Guest
-
Larry Linson #10
Re: Access + Asp + multiuser + table lock
Patrick, unfortunately, I don't do .asp, and do little ADO, so I am not a
particularly good source of details. In my experience, however, it is rarely
necessary to create temporary tables, and it causes enough people enough
trouble that it's a good idea to avoid it if there is any other way. If you
do so in Access itself, a well-regarded approach is to create a temporary
database, and then create the temporary table in the temporary database.
When it is no longer needed, you use the KILL statement to delete the whole
temporary database. But, I am not at all sure what the ADO / ADOX code would
be to accomplish this -- it's easy using DAO. You'd still need to make sure
that multiple users aren't trying to create/use the same temp table.
I don't know that you'll have to redesign the whole app, but I don't know
the equivalent of "just a squirt of oil right here and she'll run fine" for
this.
Larry Linson
Microsoft Access MVP
"Patrick" <xxx@xxx.xxx> wrote in message
news:%23Cr5Fs1IEHA.3512@TK2MSFTNGP10.phx.gbl...the>> > Except on an Access, err, Jet, database, that can lock the MDB file
> > itself. Part of your problem may very well be the single user locking
> > of the database as Larry suggested. On the other hand, even with
> > multiple users Access, um, I mean Jet, databases have some locking
> > issues. You may see it in an ADO environment where you may not see it
> > elsewhere too.
> >
> > Larry can probably go into better detail with the actual locking
> > levels, but you may need to redesign your database or move to a MSDE
> > or SQL Server database to keep from having these locking issues.
> Thanks to take the time to answer me Jeff !
> I hope i won't have to redesign my app or change my database as i'm nearly
> finished with it.
> As I'm running out of time, i prefer put a friendly error message asking> user to wait rather than redesigning the entire app !
>
> But i don't like not knowing why things do not work !
>
>
Larry Linson Guest
-
roger #11
Re: Access + Asp + multiuser + table lock
"Patrick" wrote
in> 1. Begin a transaction
> 2. Create duplicates of empty model tables : "SELECT * INTO DuplicateTable
> FROM ModelTable". Of course DuplicateTable is a unique name.
> 3. Use lot of "conn.execute sqlstring" instructions to add/delete/updateDoes 2, 1, 3, 5, 4 work?> the duplicate tables
> 4. Destroy duplicate tables
> 5. Close transaction
Since DuplicateTable is unique, do you need the transaction?
--
roger
roger Guest
-
Patrick #12
Re: Access + Asp + multiuser + table lock
> If you
> do so in Access itself, a well-regarded approach is to create a temporary> database, and then create the temporary table in the temporary database.whole> When it is no longer needed, you use the KILL statement to delete the
> temporary database. You'd still need to make sure> that multiple users aren't trying to create/use the same temp table.
OK. Thanks for the advice
> I don't know that you'll have to redesign the whole app, but I don't knowfor> the equivalent of "just a squirt of oil right here and she'll run fine"
> this.
I could try...
Thanks for all Larry
Patrick Guest
-
Patrick #13
Re: Access + Asp + multiuser + table lock
> Does 2, 1, 3, 5, 4 work?
I'm not sure to understand what you mean.
Do you think that using transactions can cause the error ?
In case of trouble (server hangs), transaction will not commit and my> Since DuplicateTable is unique, do you need the transaction?
database will not be polluted by temporary tables that should have been
destroyed.
Patrick Guest
-
Patrick #14
Re: Access + Asp + multiuser + table lock
> > 1. Begin a transaction
DuplicateTable> > 2. Create duplicates of empty model tables : "SELECT * INTOIt works ! Why ?> in> > FROM ModelTable". Of course DuplicateTable is a unique name.
> > 3. Use lot of "conn.execute sqlstring" instructions to add/delete/update>> > the duplicate tables
> > 4. Destroy duplicate tables
> > 5. Close transaction
> Does 2, 1, 3, 5, 4 work?
Patrick Guest
-
roger #15
Re: Access + Asp + multiuser + table lock
"Patrick" wrote
add/delete/update> DuplicateTable> > > 1. Begin a transaction
> > > 2. Create duplicates of empty model tables : "SELECT * INTO> > > FROM ModelTable". Of course DuplicateTable is a unique name.
> > > 3. Use lot of "conn.execute sqlstring" instructions toI don't know, sorry.>> > in> >> > > the duplicate tables
> > > 4. Destroy duplicate tables
> > > 5. Close transaction
> > Does 2, 1, 3, 5, 4 work?
> It works ! Why ?
But since "Select into" caused the problem,
moving it out of the transaction seemed sensible.
Does the error message give you any clue about
which table is locked - DuplicateTable or ModelTable?
--
roger
roger Guest
-
Patrick #16
Re: Access + Asp + multiuser + table lock
Damned !
This caused me so much trouble and the solution was so easy !
I'm not forced to use duplicates of empty tables anymore because it seems
that the problem didn't come from queries or recordsets but from the fact of
using a transaction.
Thanks for the advice roger as it helped me a lot.
But if someone has an idea why transactions causes table locks, don't
hesitate to explain !
"roger" <mothland@btopenworld.com> a écrit dans le message de
news:c5r9if$4kf$1@sparta.btinternet.com...> "Patrick" wrote
>> add/delete/update> > DuplicateTable> > > > 1. Begin a transaction
> > > > 2. Create duplicates of empty model tables : "SELECT * INTO> > > > FROM ModelTable". Of course DuplicateTable is a unique name.
> > > > 3. Use lot of "conn.execute sqlstring" instructions to>> >> > > in
> > > > the duplicate tables
> > > > 4. Destroy duplicate tables
> > > > 5. Close transaction
> > >
> > > Does 2, 1, 3, 5, 4 work?
> > It works ! Why ?
> I don't know, sorry.
>
> But since "Select into" caused the problem,
> moving it out of the transaction seemed sensible.
>
> Does the error message give you any clue about
> which table is locked - DuplicateTable or ModelTable?
>
> --
> roger
>
>
Patrick Guest
-
Bob Barrows #17
Re: Access + Asp + multiuser + table lock
Larry Linson wrote:
Patrick, if you don't have Visual Studio, the ADOX online help can be found> Patrick, unfortunately, I don't do .asp, and do little ADO, so I am
> not a particularly good source of details. In my experience, however,
> it is rarely necessary to create temporary tables, and it causes
> enough people enough trouble that it's a good idea to avoid it if
> there is any other way. If you do so in Access itself, a
> well-regarded approach is to create a temporary database, and then
> create the temporary table in the temporary database. When it is no
> longer needed, you use the KILL statement to delete the whole
> temporary database. But, I am not at all sure what the ADO / ADOX
> code would be to accomplish this -- it's easy using DAO. You'd still
> need to make sure that multiple users aren't trying to create/use the
> same temp table.
>
here:
[url]http://msdn.microsoft.com/library/en-us/ado270/htm/admscadoapireference.asp[/url]
Another article that I have found useful is:
[url]http://msdn.microsoft.com/library/en-us/dndao/html/daotoadoupdate.asp[/url]
You will find the procedure to create a database in there, although you will
have to rewrite the code examples which were written for VB to vbscript
(mostly a matter of getting rid of the type declarations from the dim
statements and replacing Set ... = New ... with Server.CreateObject)
You can use ADOX to create a database. I think you will need to use the
FileSystemObject to delete the database file once you are done with it. You
can find help with FSO at [url]www.aspfaq.com[/url].
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Patrick #18
Re: Access + Asp + multiuser + table lock
thanks Bob.
It looks that my problem comes from the use of transactions.
Check the same topic in "
microsoft.public.inetserver.asp.db" if you're interested
Patrick Guest
-
roger #19
Re: Access + Asp + multiuser + table lock
"Patrick" wrote
Well that's their purpose when you are changing data,> But if someone has an idea why transactions causes table locks, don't
> hesitate to explain !
to stop other users seeing or changing data that may
no longer be current, or even exist.
It's not so obvious when you are reading data
e.g. from ModelTable.
But if that's locked too, I'm not really *that* surprised
--
roger
roger Guest



Reply With Quote

