Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB6 Transactions

Options
  • 06-11-2007 3: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 Posts: 7,541 ✭✭✭irlrobins


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


  • Moderators, Politics Moderators Posts: 39,822 Mod ✭✭✭✭Seth Brundle


    do you know at what point it crashes?


  • Moderators, Society & Culture Moderators Posts: 9,689 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 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 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