Error in DELETE statement in Access.DBEngine

The code below works fine for UPDATE statements but throws an error for DELETE.
ReadOnly = 0;
Options = 0;
Access = actxserver('Access.Application');
db = Access.DBEngine.OpenDatabase('',Options,ReadOnly,ConnStr);
db.Execute('DELETE FROM TableName');
Error using Interface.Microsoft_Office_14.0_Access_Database_Engine_Object_Library.Database/Execute
Any ideas what I am missing?
Just to clarify, the code works on ACCESS database but fails in SQL Server.

回答 (0 件)

カテゴリ

タグ

質問済み:

sm
2016 年 2 月 2 日

編集済み:

sm
2016 年 2 月 8 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by