|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Transactions with ASP and MS Access
I have a ASP application with MS Access. I need to use transaction as there are several insert and delete statement. oConn.beginTrans commUpdate.CommandText = "delete from tableA ..." set rs = commUpdate.Execute() commUpdate.CommandText = "insert into tableA ....." set rs = commUpdate.Execute() if Err.Number <> 0 then oConn.RollBackTrans oConn.close else oConn.CommitTrans oConn.close set oConn =nothing end if Is it a correct way to use transaction? Would the server hang if there are around 10 (or less) concurrent users. Would the whole database being locked while a user is performing transactioin? Thanks in advance!
Show quote
"deadfish" <deadf***@discussions.microsoft.com> wrote in message The Jet Oledb provider doesn't support transactions.news:795ABDC6-BD10-4473-A7F7-A4536E62BAAF@microsoft.com... > Hi, > > I have a ASP application with MS Access. I need to use transaction as > there > are several insert and delete statement. > > oConn.beginTrans > > commUpdate.CommandText = "delete from tableA ..." > set rs = commUpdate.Execute() > > commUpdate.CommandText = "insert into tableA ....." set rs = > commUpdate.Execute() > > if Err.Number <> 0 then > oConn.RollBackTrans > oConn.close > else > oConn.CommitTrans > oConn.close > set oConn =nothing > > end if > > Is it a correct way to use transaction? Would the server hang if there are > around 10 (or less) concurrent users. Would the whole database being > locked > while a user is performing transactioin? > > > Thanks in advance! > -- Mike Brind Mike Brind wrote:
> That's news to me Mike. Got a cite?> The Jet Oledb provider doesn't support transactions. > -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message I stand corrected.news:%23uNvvYWJIHA.5764@TK2MSFTNGP06.phx.gbl... > Mike Brind wrote: >> >> The Jet Oledb provider doesn't support transactions. >> > > That's news to me Mike. Got a cite? > Mike deadfish wrote:
> Hi, no,no,no - this query does not return records. There is no need for a> > I have a ASP application with MS Access. I need to use transaction as > there are several insert and delete statement. > > oConn.beginTrans > > commUpdate.CommandText = "delete from tableA ..." > set rs = commUpdate.Execute() recordset object. Do this instead to make sure ADO doesn't create an unnecessary recordset object: commUpdate.Execute ,,129 > See above> commUpdate.CommandText = "insert into tableA ....." > set rs =commUpdate.Execute() > > if Err.Number <> 0 then Outside of the mistake of using a recordset object to run queries that> oConn.RollBackTrans > oConn.close > else > oConn.CommitTrans > oConn.close > set oConn =nothing > > end if > > Is it a correct way to use transaction? don't retrieve records, this seems reasonable. Typically, you would check for errors after each statement. See tip 9 on this page: http://www.windowsdevcenter.com/pub/a/oreilly/windows/news/ado_0601.html?page=last PS. Most of the tips on that page are applicable to VB/VBA, not vbscript being used in ASP. > Would the server hang if I don't know. You'll have to test it in your environment.> there are around 10 (or less) concurrent users. > Would the whole Possibly, but probably not. Again, testing will answer this question.> database being locked while a user is performing transactioin? > -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup.
Other interesting topics
|
|||||||||||||||||||||||