Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

ADO begintrans and commint trans

Hi,
How to use begin trans and commit trans when we execute a strored procedure using ado command.
I have a stroed procedure to inser values... if i use...sql query to insert its working..
if i use command.. it gives as error.

con.open
con.begintrans
con.execte(--sqlquery--)
con.committrans

same thing in command

con.open
' assigned the storedprocedure paramertes and type.
'
con.begintrans
cmdCommand.activeconnection = con ' gives an error say connection busy...
cmdcommand.execute
con.comminttrans

solution please
-Arjun
[627 byte] By [Arjun] at [2007-11-11 6:53:15]
# 1 Re: ADO begintrans and commint trans
Did you try setting the ActiveConnection property before calling BeginTrans?
pclement at 2007-11-11 23:47:58 >
# 2 Re: ADO begintrans and commint trans
Yes i tried different error message.........

-Arjun
Arjun at 2007-11-11 23:49:06 >
# 3 Re: ADO begintrans and commint trans
What is the different error message?
pclement at 2007-11-11 23:50:05 >
# 4 Re: ADO begintrans and commint trans
the message is : Cannot create new transaction because capacity was exeeded
-Arjun
Arjun at 2007-11-11 23:51:10 >
# 5 Re: ADO begintrans and commint trans
Just to verify, do you have any open Recordsets on the Connection before you try to start the transaction?
pclement at 2007-11-11 23:52:03 >
# 6 Re: ADO begintrans and commint trans
I close the recordset after using.. and there is no opened recordset.
I use commands to get the recordset..
-Arjun
Arjun at 2007-11-11 23:53:02 >
# 7 Re: ADO begintrans and commint trans
Sorry, I'm not sure what else to suggest.
pclement at 2007-11-11 23:54:11 >