msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trasanction opened....?

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
Erik



Joined: 04 Oct 2007
Posts: 2

PostPosted: Fri Sep 12, 2003 9:31 pm    Post subject: Trasanction opened....? Reply with quote

Hy guys, I have a little question for you.....

Using ADO I opened a transaction (BeginTrans)
after some other operations I need to test if my transaction was opened
How I can verify it?
Do exist some ADO statement or property that inform on thet transaction
state?

Thank you a lot for your Help
Erik

Archived from group: microsoft>public>data>odbc
Back to top
View user's profile Send private message
Val Mazur



Joined: 04 Oct 2007
Posts: 15

PostPosted: Sun Sep 14, 2003 1:46 pm    Post subject: Re: Trasanction opened....? Reply with quote

Hi Erik,

You could query SQL Server for level of transaction using next SQL statement

SELECT @@TRANCOUNT

It will return you level of nesting

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp


"Erik" wrote in message@TK2MSFTNGP10.phx.gbl...
> Hy guys, I have a little question for you.....
>
> Using ADO I opened a transaction (BeginTrans)
> after some other operations I need to test if my transaction was opened
> How I can verify it?
> Do exist some ADO statement or property that inform on thet transaction
> state?
>
> Thank you a lot for your Help
> Erik
>
>
Back to top
View user's profile Send private message
vbwonderer



Joined: 04 Oct 2007
Posts: 3

PostPosted: Mon Sep 15, 2003 5:57 am    Post subject: Re: Trasanction opened....? Reply with quote

IMHO,Val' solution is not in ADO spirit. What if Erik uses
another (not MS) DBMS ?
The function BeginTrans (in ADO 2.7) returns the level of
nesting (for those DB providers that support nested
transactions).
For DB providers that do not support nested transactions,
calling BeginTrans within an open transaction generates an
error (I suppose).

>-----Original Message-----
>Hi Erik,
>
>You could query SQL Server for level of transaction using
next SQL statement
>
>SELECT @@TRANCOUNT
>
>It will return you level of nesting
>
>--
>Val Mazur
>Microsoft MVP
>Check Virus Alert, stay updated
>http://www.microsoft.com/security/incident/blast.asp
>
>
>"Erik" wrote in message
>@TK2MSFTNGP10.phx.gbl...
>> Hy guys, I have a little question for you.....
>>
>> Using ADO I opened a transaction (BeginTrans)
>> after some other operations I need to test if my
transaction was opened
>> How I can verify it?
>> Do exist some ADO statement or property that inform on
thet transaction
>> state?
>>
>> Thank you a lot for your Help
>> Erik
>>
>>
>
>
>.
>

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group