Discussion:
Run-time error:'-2147168237(8004d013)'
(too old to reply)
m***@gmail.com
2016-10-14 00:17:47 UTC
Permalink
I've ran into a run-time error:'-2147168237(8004d013)': Only one
transcation can be processed in this moment.
Does anyone have any idea about this error?
Thanks in advance.
Steven Cheng
I have also encountered this error and I'm also using ADO (OLEDB) to connect to SQL Server. What can I do to fix this?

Michelle Relevo
ralph
2016-10-14 05:34:46 UTC
Permalink
Post by m***@gmail.com
I've ran into a run-time error:'-2147168237(8004d013)': Only one
transcation can be processed in this moment.
Does anyone have any idea about this error?
Thanks in advance.
Steven Cheng
I have also encountered this error and I'm also using ADO (OLEDB) to connect to SQL Server. What can I do to fix this?
Michelle Relevo
Your code is attempting to perform a "nested transaction". Only a very
few OLEDB Provider will allow (or able to manage multiple transactions
within one session). The Jet 4.0 OLEDB Provider was the only MS one I
know that could, but there may be a 3rd party Provider for SQL Server
out there that will.

Nested Transactions:
https://msdn.microsoft.com/en-us/library/ms716985(v=vs.85).aspx

In otherwords the following basic construct will produce the error ...
Begin Trans
Execute( some statement )
Begin Trans <-- INVALID NESTED TRANSACTION
Execute( another statement )
Commit Trans <-- more errors
Commit Trans
(Warining! psuedocode and air code )

Note: It doesn't have to be so obviously linear code as above, the
transactions may be called from apparently separated code, but the
calls are still part of the same *session*.

So remove the nested Transactions or find another Provider that will
support them.
ralph
2016-10-14 05:43:17 UTC
Permalink
Post by ralph
So remove the nested Transactions or find another Provider that will
support them.
For completness I forgot the 3rd option - write your own provider.
However, you can't do that with VB, and it is a non-trival project.
<g>

Loading...