Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Does access support transactions?

    Does access support transactions?

    If so how could i flash a msg box on the # of records updated,inserted or deleted in a y/n msgbox and then decide on rolling back the tran??


    ~M

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    In a word: yes.

    Your second question: You'd have to keep a rolling count of each action and pop a messagebox ... Or use a form to mimic a messagebox ...

  3. #3
    Join Date
    Oct 2003
    Posts
    311
    are trans only supported when working with sql server?

    I cant find any data or code examples in help

    can u give a quick code example??

    ~M

  4. #4
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    From Access 2000 help:

    In a Microsoft Jet workspace, you can also use the Transactions property with dynaset- or table-type Recordset objects. Snapshot- and forward-only–type Recordset objects always return False.

    There is a lengthy example there.

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try this function which support Transaktions


    Function PutSQLStatement(SQLStatement As String)
    On Error GoTo FehlerPutSQLStatement
    Dim ws As Workspace
    Dim db As Database

    Set ws = DBEngine.Workspaces(0)
    Set db = CurrentDb()

    ws.BeginTrans
    db.Execute SQLStatement, DB_FAILONERROR
    ws.CommitTrans
    PutSQLStatement = 1
    Exit Function

    FehlerPutSQLStatement:
    ws.Rollback
    MsgBox "Error " & Err.number & " in SQL Statement: " & vbNewLine & " " & Err.number & Err.Description & vbNewLine & "Called from: " & vbNewLine & vbNewLine & _
    " PutSQLStatement([" & SQLStatement & "])", vbOKOnly + vbInformation, "PutSQLStatement(.)"
    PutSQLStatement = 0
    Exit Function

    End Function

Posting Permissions

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