By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,932 Members | 1,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,932 IT Pros & Developers. It's quick & easy.

ADO Transaction Question

P: n/a
I have a long and complex data manipulation algorithm written in ADO that
performs about 20 different data manipulation processes sequentially. I
intend to finalise this function (lets call it AddSessions() by setting it
to perform within a Transaction with Rollback etc. Only problem is that, as
per good coding principles, some of the routines that manipulate the data
are contained in subroutines that are called by the main routine. eg

Function AddSessions()

call DeleteExisting()
call AddAllocations()

End Function

These also use ADO. How does this work with transactions? In order to
encapsulate the whole thing within a single transaction will I need to
'promote' the code from these subroutine calls into the main function?


Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Wed, 22 Dec 2004 00:43:29 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Not at all. As long as all functions use the same connection object
(which has the BeginTrans and other methods), you are fine.
When a problem occurs in a subroutine, just use Err.Raise to signal
that to the main function, which can trap that error in its error
handler and perform a connection.Rollback.

-Tom.

I have a long and complex data manipulation algorithm written in ADO that
performs about 20 different data manipulation processes sequentially. I
intend to finalise this function (lets call it AddSessions() by setting it
to perform within a Transaction with Rollback etc. Only problem is that, as
per good coding principles, some of the routines that manipulate the data
are contained in subroutines that are called by the main routine. eg

Function AddSessions()

call DeleteExisting()
call AddAllocations()

End Function

These also use ADO. How does this work with transactions? In order to
encapsulate the whole thing within a single transaction will I need to
'promote' the code from these subroutine calls into the main function?


Nov 13 '05 #2

P: n/a
Thanks Tom. Is this also true of .execute statements within the code using
the same connection?
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:mq********************************@4ax.com...
On Wed, 22 Dec 2004 00:43:29 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Not at all. As long as all functions use the same connection object
(which has the BeginTrans and other methods), you are fine.
When a problem occurs in a subroutine, just use Err.Raise to signal
that to the main function, which can trap that error in its error
handler and perform a connection.Rollback.

-Tom.

I have a long and complex data manipulation algorithm written in ADO that
performs about 20 different data manipulation processes sequentially. I
intend to finalise this function (lets call it AddSessions() by setting itto perform within a Transaction with Rollback etc. Only problem is that, asper good coding principles, some of the routines that manipulate the data
are contained in subroutines that are called by the main routine. eg

Function AddSessions()

call DeleteExisting()
call AddAllocations()

End Function

These also use ADO. How does this work with transactions? In order to
encapsulate the whole thing within a single transaction will I need to
'promote' the code from these subroutine calls into the main function?

Nov 13 '05 #3

P: n/a
On Wed, 22 Dec 2004 05:30:11 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Try it. My bet is that it works.
-Tom.

Thanks Tom. Is this also true of .execute statements within the code using
the same connection?
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:mq********************************@4ax.com.. .
On Wed, 22 Dec 2004 00:43:29 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Not at all. As long as all functions use the same connection object
(which has the BeginTrans and other methods), you are fine.
When a problem occurs in a subroutine, just use Err.Raise to signal
that to the main function, which can trap that error in its error
handler and perform a connection.Rollback.

-Tom.

>I have a long and complex data manipulation algorithm written in ADO that
>performs about 20 different data manipulation processes sequentially. I
>intend to finalise this function (lets call it AddSessions() by settingit >to perform within a Transaction with Rollback etc. Only problem is that,as >per good coding principles, some of the routines that manipulate the data
>are contained in subroutines that are called by the main routine. eg
>
>Function AddSessions()
>
>call DeleteExisting()
>call AddAllocations()
>
>End Function
>
>These also use ADO. How does this work with transactions? In order to
>encapsulate the whole thing within a single transaction will I need to
>'promote' the code from these subroutine calls into the main function?
>
>
>


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.