The thing is that I want to have these scripts run in seperate places in sqlserer. to clarigfy it needs to be described more.
What I really want is a Transaction Management which is written in sql on my application and wrap all of the sql opearations using ADO that run in my application.
Suppose this:
AdoConnecton.Execute('Begi
AdoConnecton.Execute(Save Tran T1');
...
we can have here some ado operations.
--
AdoConnecton.Execute('Begi
---
...
in some case
AdoConnecton.Execute(Rollb
or
AdoConnecton.Execute(Commi
.
.
.
As you see my problem is broader than that. Having Considered this, I concluded that the problem relates to opening server side cursors from ole-db provider. whenever you do that sqlserver ,as the Microsoft's sqlserver support site said, create an implied login in a current login and the problem is generated.
By the way, Having Sad all of that, I am still hopefull that perhaps there is a solution.
Any Help Would Be Apprecated, Dear Friends.
Thanks for reading.
With Regard.
Main Topics
Browse All Topics





by: JaymolPosted on 2008-12-30 at 04:48:27ID: 23262085
I'd recommend either using a TADOQuery to run the whole thing (instead of individual executes), or run the commands all in one go...
are @T int; Set @T = 2');
AdoConnecton.Execute('Decl
It's not a cursor issue - it's to do with commands being executed as a discrete process, which is closed after each execute. It's the same as doing an EXEC command directly on the server.
It's better to use an ADOQuery for the script, as this gets executed in one go and should solve your problem. If there's a reason why you don't want to do this, you'll have to explain and we can take it from there. Otherwise, one of those suggestions should do the trick.
Cheers,
Jonh.