MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 4th, 2004, 01:04 PM
rolandpish rolandpish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 165 rolandpish User rank is Private First Class (20 - 50 Reputation Level)rolandpish User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 1 h 21 m 53 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old August 5th, 2004, 01:55 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is online now
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,507 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 7 m 35 sec
Reputation Power: 865
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

Reply With Quote
  #3  
Old August 5th, 2004, 05:26 PM
rolandpish rolandpish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 165 rolandpish User rank is Private First Class (20 - 50 Reputation Level)rolandpish User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 1 h 21 m 53 sec
Reputation Power: 5
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > SQLServer2000 vs ADO VB6


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway