1

I manage an Excel 2007 sheet using SQL, using the following connection string:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source='Invoice.xlsm';Extended Properties='Excel 12.0;IMEX=1;HDR=Yes'

Everything works just as it should apart from the Delete statement. When I try to perform Delete From [tablename$] where code like '1'), I get an error -2147467259 (80004005).

I can't explain it, since all the other select and insert statements work just fine.

3
  • Ok. What ever I have tried, does not resolve the problem. I guess that perhaps Delete statements are not allowed for some reason. I am thinking of using a temporary sheet to write all data apart from the ones to be deleted and then ovewrite the original sheet with it. Commented Feb 12, 2013 at 13:43
  • What is the actual text of that error message? Does it offer any useful clues? Commented Feb 12, 2013 at 13:59
  • I am afraid not. It is a general sql error reporting that data cannot be deleted Commented Feb 12, 2013 at 14:03

1 Answer 1

2

After searching few hours in Microsoft Support, i found the following:

The Catalog object has a Create method but does not have a Delete method.

I guess there is no way to perform an SQL Delete statement, in excel sheets.

Sign up to request clarification or add additional context in comments.

1 Comment

The ACE.OLEDB driver does not support Delete as you have found, but you can use another driver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.