I would like to use transaction (start, complete, accept change) to UPDATE 2 MS Access tables, but I don't know how:
Dim dbConn = New OleDbConnection(strAccess)
Dim cmdMSA As OleDbCommand
dbConn.Open()
' Update GuestList
cmdText = "UPDATE GuestList SET Conf = '123456789' WHERE Name = 'TESTING'"
cmdMSA = New OleDbCommand(cmdText, dbConn)
Try
If Not (cmdMSA.ExecuteScalar() = Nothing) Then
f_Failed = True
End If
Catch ex As Exception
DisplayError(Now().ToString() & " Can't UPDATE GuestList")
End Try
cmdMSA.Dispose()
' Update CompanyList
cmdText = "UPDATE CompanyList SET Name = 'ABC' WHERE Phone = '514-222-3333'"
cmdMSA = New OleDbCommand(cmdText, dbConn)
Try
If Not (cmdMSA.ExecuteScalar() = Nothing) Then
f_Failed = True
End If
Catch ex As Exception
DisplayError(Now().ToString() & " Can't UPDATE CompanyList")
End Try
cmdMSA.Dispose()
dbConn.Close()
Thank you for any help
Dim dbConn = New OleDbConnection(strAccess)
Dim cmdMSA As OleDbCommand
dbConn.Open()
' Update GuestList
cmdText = "UPDATE GuestList SET Conf = '123456789' WHERE Name = 'TESTING'"
cmdMSA = New OleDbCommand(cmdText, dbConn)
Try
If Not (cmdMSA.ExecuteScalar() = Nothing) Then
f_Failed = True
End If
Catch ex As Exception
DisplayError(Now().ToString() & " Can't UPDATE GuestList")
End Try
cmdMSA.Dispose()
' Update CompanyList
cmdText = "UPDATE CompanyList SET Name = 'ABC' WHERE Phone = '514-222-3333'"
cmdMSA = New OleDbCommand(cmdText, dbConn)
Try
If Not (cmdMSA.ExecuteScalar() = Nothing) Then
f_Failed = True
End If
Catch ex As Exception
DisplayError(Now().ToString() & " Can't UPDATE CompanyList")
End Try
cmdMSA.Dispose()
dbConn.Close()
Thank you for any help
Last edited: