4

I've read that MS Access supports transactions but when I try to use it, I get the error Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. All I'm writing out is...

BEGIN TRANSACTION
    INSERT INTO MyTable1(Field1, Field2, etc...) VALUES (Value1, Value2, etc...)
    INSERT INTO MyTable2(Field1, Field2, etc...) VALUES (Value1, Value2, etc...)
COMMIT TRANSACTION

This is in a stored query in Access. Why is it giving me this error if it is supported?

http://msdn.microsoft.com/en-us/library/office/bb208950(v=office.12).aspx

Shane LeBlanc
  • 2,633
  • 13
  • 42
  • 74

1 Answers1

4

Transactions are not supported in MSAccess when you are using them in a query. Try firing a function to create those queries, which you can do in a module and have it run on PageLoad or even an OnTimer event. You can use the BeginTrans and Rollback commands inside the module.

Johnny Bones
  • 8,786
  • 7
  • 52
  • 117