Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

VB6 Transactions

  • 06-11-2007 03:44PM
    #1
    Closed Accounts Posts: 426 ✭✭


    we develop a system that uses Acces Links Tables with an sql server 2000 DB

    if i begin a transaction(begintrans)

    and do a select statement from a table
    and update or insert

    and another select it iwll crash can anybody help me
    if i skip over the begintrans its fine

    anybody any ideas ?


Comments

  • Registered Users, Registered Users 2 Posts: 7,541 ✭✭✭irlrobins


    Post code up, and any error messages that display. The more info you give the better


  • Moderators, Politics Moderators, Paid Member Posts: 44,236 Mod ✭✭✭✭Seth Brundle


    do you know at what point it crashes?

    Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/ .



  • Moderators, Society & Culture Moderators Posts: 9,688 Mod ✭✭✭✭stevenmu


    I'd guess at the second select ?

    I think I remember something about this. If this is selecting some of the data which has already been updated/inserted I think it will cause an error. You need to commit the changes before you can select on them again.


  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    Sounds like the second select alright.. you can set the isolation level of the transaction to read_uncommitted

    But possibly best to have a commit trans or rollback before the the second select


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    stevenmu wrote: »
    I think I remember something about this. If this is selecting some of the data which has already been updated/inserted I think it will cause an error. You need to commit the changes before you can select on them again.


    I also vaguely remember something about this style of problem.

    At one point, there was a bug (VB? Java? C#? I can't remember) where if you didn't go to the end of the first recordset, inside a transaction, a subsequent SELECT would cause a crash.

    As general advice, you should be questioning the design-logic which has you running a select inside a transaction. There are occasions where it really is unavoidable, but they're pretty few and far between.


  • Advertisement
Advertisement