Can I use Transaction? 
Author Message
 Can I use Transaction?

Hi All:

A newbie to ADO transaction.
I have a VB program to let users enter record and modify
records on a form. Right now I want to use transaction,
but I don't know whether it is possible or not. Between
transaction Begin and Commit, users have some actions to
do - modify some records and add some new records, and I
am afraid during that some errors may occour. I have no
experience to apply transaction. In my case, Can I use
transaction to commit the final changing or I just define
a temp table to achieve my goal?

Thanks in advance
Andy



Tue, 07 Sep 2004 05:25:43 GMT  
 Can I use Transaction?
If your provider supports it you can use transactions on the Connection
Object.

Using JET on Access works.

Transactions are more elegant than temp tables.

If you would like to experiment with transactions (and nested transactions)
then try the free browser here www.adoanywhere.com/fab

Once you get the hang of them you will need isolation levels and lock type.
They are available in our full browser ( Trial  www.adoanywhere.com/cnet )

--
Michael Collier Bsc (Hons)

Interactive ADO Browser Trial  www.adoanywhere.com/cnet
Free ADO Browser (FAB)  www.adoanywhere.com/fab
Home Page www.adoanywhere.com

--


Quote:
> Hi All:

> A newbie to ADO transaction.
> I have a VB program to let users enter record and modify
> records on a form. Right now I want to use transaction,
> but I don't know whether it is possible or not. Between
> transaction Begin and Commit, users have some actions to
> do - modify some records and add some new records, and I
> am afraid during that some errors may occour. I have no
> experience to apply transaction. In my case, Can I use
> transaction to commit the final changing or I just define
> a temp table to achieve my goal?

> Thanks in advance
> Andy



Tue, 07 Sep 2004 06:18:36 GMT  
 Can I use Transaction?
Andy

First of all, you should keep your transactions as short as possible.  You
should let the user make his/her changes, and then save the changes in a
transaction.

As for writing the transaction, look at the following sample:

begin tran
update tableA ...
if error then rollback, exit
update tableB
if error then rollback, exit
insert tableC
if error then rollback, exit
commit tran

Bobx


Quote:
> Hi All:

> A newbie to ADO transaction.
> I have a VB program to let users enter record and modify
> records on a form. Right now I want to use transaction,
> but I don't know whether it is possible or not. Between
> transaction Begin and Commit, users have some actions to
> do - modify some records and add some new records, and I
> am afraid during that some errors may occour. I have no
> experience to apply transaction. In my case, Can I use
> transaction to commit the final changing or I just define
> a temp table to achieve my goal?

> Thanks in advance
> Andy



Tue, 07 Sep 2004 15:41:46 GMT  
 Can I use Transaction?
Thanks all for reply.

Right now I determine to apply transaction to my project.
Can you recommend a book or website that demonstrates how
to use transaction in VB?

Thanks
Andy

Quote:
>-----Original Message-----
>Hi All:

>A newbie to ADO transaction.
>I have a VB program to let users enter record and modify
>records on a form. Right now I want to use transaction,
>but I don't know whether it is possible or not. Between
>transaction Begin and Commit, users have some actions to
>do - modify some records and add some new records, and I
>am afraid during that some errors may occour. I have no
>experience to apply transaction. In my case, Can I use
>transaction to commit the final changing or I just define
>a temp table to achieve my goal?

>Thanks in advance
>Andy
>.



Tue, 07 Sep 2004 22:20:35 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How do I create a canned form?

2. Canned AcctReceivable Module needed!

3. Canned pages....

4. Cans access2.0 engine access btrieve files?

5. Crystal Reports Canned Code

6. Canned objects and/or images

7. Switching from inhouse software to canned package.

8. line graph in vb (canned routine)

9. 'Canned' data in VB program

10. Looking 4 Canned Control

11. To Transaction or Not to Transaction that is the question

12. ADODB TRANSACTION ADO ERROR No Transaction is Active

 

 
Powered by phpBB® Forum Software