diff options
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index b408f39935ce..5d04f13117e1 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1102,8 +1102,19 @@ bool ODbaseTable::CreateImpl() if (!CreateMemoFile(aURL)) { aURL.setExtension(aExt); // kill dbf file - Content aMemoContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>(), comphelper::getProcessComponentContext()); - aMemoContent.executeCommand( "delete", css::uno::Any( true ) ); + try + { + Content aMemoContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>(), comphelper::getProcessComponentContext()); + aMemoContent.executeCommand( "delete", css::uno::Any( true ) ); + } + catch(const ContentCreationException&) + { + const OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( + STR_COULD_NOT_DELETE_FILE, + "$name$", aName + ) ); + ::dbtools::throwGenericSQLException( sError, *this ); + } return false; } m_aHeader.db_typ = dBaseIIIMemo; |