Results 1 to 7 of 7

Thread: Transaction??????!!!!!!!!

  1. #1

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Question

    I'm using VB6 with ADO to connect to Access.
    I have a form which is used for batch input, and another form which is used to view all the batches.
    On the input form you can add, alter and delete items from a batch. In each of these cases a Transaction is used, and all works fine. From the batch view form (which displays all batches in a listview) you can double click on any batch item, and the batch input form is displayed with the details displayed for the selected batch item. The problem is when I try to delete or alter this item I get the following error message, and I have absolutely no idea why.

    -2147467259 Attribute can not be set now.

    It occurs on the BeginTrans statement.

    Please HELP!!

    [Edited by Stevie on 05-03-2000 at 05:40 PM]

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    Are you trying to set the recordset before the begintran??

  3. #3

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Nope.

    It all works fine when using the batch input form. It only keels over when using the functionality in the form from another form.

  4. #4
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    If i remember correctly, you can not have an open recordset before the begintrans. All the recordsets must be close before you open a transaction. Then open another recordset in that transaction. Try this.

  5. #5

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    As far as I can see I have no recordsets open. I have so many that it is easy to miss in the code.

    Is there a way of closing all open recordsets?

  6. #6

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    I've just been looking through the help about transactions, and in it they give an example where a recordset is open just before the BeginTrans, so that appears not to be the problem.

    Any other ideas?

  7. #7

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Thumbs up

    Talk about conflicting info. In the help it gives an example with an open recordset before a BeginTrans statement, but whilst searching through MSDN I found something that said you should close the connection and re-open it.

    To cut a long story short, I closed and re-opened the connection before the BeginTrans statement (when using from another form) and it all works well.

    Thanks for the help.

    [Edited by Stevie on 05-05-2000 at 12:05 AM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width