dropping a table using OLEDB provider

  • Thread starter Thread starter Satish
  • Start date Start date
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
 
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.
__________________________________
 
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
 
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?
 
Back
Top