|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQLServer2000 vs ADO VB6
Hi, I have a little question regarding
SQLServer2000 vs ADO of Visual Basic 6 In a code snipplet a have something like: Conn1.BeginTrans Set rec_tmp = Conn1.Execute("SELECT * FROM IDENTIFICATIONS;") Conn1.Execute "DELETE FROM CARS WHERE CAR_ID = 8;" . . . Conn1.CommitTrans and whe VB tries to execute the line with the DELETE sentence the Err object says something like: "cannot create a new connection because you are in distributed or manual transaction mode" However, if I remove the line that executes the sentence SELECT * FROM IDENTIFICATIONS the error never shows up. Seems like I canīt execute a SELECT before a DELETE/UPDATE even if I execute the SELECT in some other table. Iīve tried changing the IsolationLevel, Mode and Cursor Location properties and the error always occurs. Furthermore, I tried putting the SELECT out of the transaction and the error continues showing up. Why does this occurs? Is there a way to solve it? NOTE: I need forcely to execute that SELECT before the DELETE. Thanks for the time Roland |
|
#2
|
||||
|
||||
|
Try changing the CursorType to adOpenStatic (default is adForwardOnly)
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
|
#3
|
|||
|
|||
|
Great! I solved the problem, but other problem came up.
I have a global variable called rec_1 as New ADODB.Recordset Before the transaction rec_1 has some information, The problem is: after the execution of Conn1.CommitTrans I lose the information in rec_1, because the error is as following: A call has made to ITransaction::Commit or ITransaction::Abort and the object is unstable Does this means that after any call to commit transaction I will lose the information on all recordsets including global ones? Do I need to change the Cursor Type or other similar property to solve this? Really thanks for the time, Roland |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQLServer2000 vs ADO VB6 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|