473,387 Members | 1,897 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,387 software developers and data experts.

Transactions with ASP and MS Access

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!

Nov 12 '07 #1
4 1572

"deadfish" <de******@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.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!
The Jet Oledb provider doesn't support transactions.

--
Mike Brind
Nov 12 '07 #2
Mike Brind wrote:
>
The Jet Oledb provider doesn't support transactions.
That's news to me Mike. Got a cite?

--
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.
Nov 12 '07 #3
deadfish wrote:
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()
no,no,no - this query does not return records. There is no need for a
recordset object. Do this instead to make sure ADO doesn't create an
unnecessary recordset object:

commUpdate.Execute ,,129
>
commUpdate.CommandText = "insert into tableA ....."
set rs =commUpdate.Execute()
See above
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?
Outside of the mistake of using a recordset object to run queries that
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/...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
there are around 10 (or less) concurrent users.
I don't know. You'll have to test it in your environment.
Would the whole
database being locked while a user is performing transactioin?
Possibly, but probably not. Again, testing will answer this question.

--
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.
Nov 12 '07 #4

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Mike Brind wrote:
>>
The Jet Oledb provider doesn't support transactions.

That's news to me Mike. Got a cite?
I stand corrected.

Mike
Nov 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David Bray | last post by:
I have an Access database on an ISP's web-space which is accessed through ASP - all standard stuff. Can anyone tell me whether ASP's object.context methods for transactions will work with...
4
by: Raposa Velha | last post by:
So, chosen the interface for my app, finally I got stuck with transactions. Boy!, how many ways of doing the same job are there?! Any suggestion so I could find myself in the right direction?...
9
by: TD | last post by:
I am trying to add transactions to my code. The original code worked fine until I followed an example to setup transactions, now the code does strange things, but no error messages. Could...
1
by: ljubo lecic via AccessMonster.com | last post by:
I am developing a complex ACCESS aplication. My question is: If I have A few update queries that are called within after-update event in the form( queries updating another tables) I am wandering...
11
by: Mike P | last post by:
I've been using C# transactions for a while and had no problems with them. Using try catch blocks I can trap basically all possible errors and rollback all necessary data. Over the last few...
1
by: mark | last post by:
In Java, you can use JBoss or similar to host EJB that will manage your transactions for you. You could, of course, write your own transactions using JDBC. In .NET, we can specify our own...
2
by: Adnan | last post by:
Hey Ppl, I'm developing an Online Auction Site using ASP.net and am experiencing a problem with Transactions in ADO.Net. When beginTrasaction() function is invoked from a specific connection,...
7
by: Karen Hill | last post by:
Hi. I need to use transactions to make sure data is consistent. I have a combo box that when changed to a new value updates a table. I then have a DoCmd.RunSQL statement following that in the...
2
by: Sridhar | last post by:
Hi, I am trying to implement sql transactions. But I am not knowing how to do that. I created a data access layer which contains methods to select/insert/update tables in a database. I have also...
12
by: Rami | last post by:
I have some requirement for an automated payment system. The system has four machines setup as follows: 1- Two machines have a clustered database. 2- Two machines have a .net business logic...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.