你用代码删除数据库?sqlserver还是Access?
你最好是弄一个事务,然后直接调用,参考
http://www.cnblogs.com/safezone/articles/1251224.html
http://ryxxlong.iteye.com/blog/1045273