dropping a table using OLEDB provider

S

Satish

Hello,


I'm trying to delete a table in an excel file. I'm
executing the "DROP TABLE tablename" via a OleDBCommand
object by calling ExecuteNonQuery.

The command fails(the table still exists) but no
exception is thrown. When I set the table name to a non-
existent table an error is popped out so I'm pretty sure
it sees the table.


Why doesn't the table get deleted?

Satish
 
W

William \(Bill\) Vaughn

Perhaps your login does not have DDL permission.

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
M

Mary Chipman

Do you mean you are trying to delete a worksheet in a workbook, or a
range in a worksheet? I don't think you can use DDL to manipulate
Excel objects.

-- Mary
MCW Technologies
http://www.mcwtech.com
 
L

Lyndon Hills

Hello,


I'm trying to delete a table in an excel file. I'm
executing the "DROP TABLE tablename" via a OleDBCommand
object by calling ExecuteNonQuery.

The command fails(the table still exists) but no
exception is thrown. When I set the table name to a non-
existent table an error is popped out so I'm pretty sure
it sees the table.


Why doesn't the table get deleted?

Satish
Maybe other tables are referencing it via foreign key constraints?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top