Results 1 to 5 of 5

Thread: beginTrans,CommitTrans .. Please Help

  1. #1

    Thread Starter
    Addicted Member wernerh's Avatar
    Join Date
    Sep 2000
    Posts
    170

    beginTrans,CommitTrans .. Please Help

    Hi I've added a begintrans command to my code in the following way:

    conn.begintrans

    rs1.open
    rs1.addnew
    'added all my data
    rs1.update

    rs2.open
    rs2.addnew
    'added all my data
    rs2.update

    conn.committrans

    I've then gone and delete these transactions using code like this

    conn.execute "delete from table1"

    when I then re-do the transaction I get the following error on the begintrans command.

    when using a sequal database:

    "Transaction can not start because more than one odbc connection in use

    when using an access database:

    "Can not set attribute at this time"

    can you please tell me what I am doing wrong

  2. #2
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    You need to have a Connection for each Recordset if you are opening them together.
    Then BeginTrans & CommitTrans is used for each.

  3. #3
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    try closing each recordset after you've updated...
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  4. #4
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    try closing each recordset after you've updated...
    Yes, good advice never leave a recordset open after you've used it.
    Then CommitTrans after you close it and BeginTrans next line before you open it again.
    Thay way you'll only need 1 connection.

  5. #5
    Addicted Member
    Join Date
    Nov 2001
    Posts
    130
    r u using DSN connection or ADODB connection.
    if DSN change it to ADODB, then try

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