summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp')
-rw-r--r--cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp49
1 files changed, 27 insertions, 22 deletions
diff --git a/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp b/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
index cb92e2fd80..b8c020fabe 100644
--- a/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
+++ b/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
@@ -954,28 +954,33 @@ MSSqlProvider::createDb(_ConnectionPtr conn, const std::string &name)
" (messageId bigint REFERENCES tblMessage(persistenceId) NOT NULL,"
" queueId bigint REFERENCES tblQueue(persistenceId) NOT NULL)";
_variant_t unused;
- _bstr_t dbStr = dbCmd.c_str();
- conn->Execute(dbStr, &unused, adExecuteNoRecords);
- _bstr_t useStr = useCmd.c_str();
- conn->Execute(useStr, &unused, adExecuteNoRecords);
- std::string makeTable = tableCmd + TblQueue + colSpecs;
- _bstr_t makeTableStr = makeTable.c_str();
- conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
- makeTable = tableCmd + TblExchange + colSpecs;
- makeTableStr = makeTable.c_str();
- conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
- makeTable = tableCmd + TblConfig + colSpecs;
- makeTableStr = makeTable.c_str();
- conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
- makeTable = tableCmd + TblMessage + colSpecs;
- makeTableStr = makeTable.c_str();
- conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
- makeTable = tableCmd + TblBinding + bindingSpecs;
- makeTableStr = makeTable.c_str();
- conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
- makeTable = tableCmd + TblMessageMap + messageMapSpecs;
- makeTableStr = makeTable.c_str();
- conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ _bstr_t dbStr = dbCmd.c_str();
+ try {
+ conn->Execute(dbStr, &unused, adExecuteNoRecords);
+ _bstr_t useStr = useCmd.c_str();
+ conn->Execute(useStr, &unused, adExecuteNoRecords);
+ std::string makeTable = tableCmd + TblQueue + colSpecs;
+ _bstr_t makeTableStr = makeTable.c_str();
+ conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ makeTable = tableCmd + TblExchange + colSpecs;
+ makeTableStr = makeTable.c_str();
+ conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ makeTable = tableCmd + TblConfig + colSpecs;
+ makeTableStr = makeTable.c_str();
+ conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ makeTable = tableCmd + TblMessage + colSpecs;
+ makeTableStr = makeTable.c_str();
+ conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ makeTable = tableCmd + TblBinding + bindingSpecs;
+ makeTableStr = makeTable.c_str();
+ conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ makeTable = tableCmd + TblMessageMap + messageMapSpecs;
+ makeTableStr = makeTable.c_str();
+ conn->Execute(makeTableStr, &unused, adExecuteNoRecords);
+ }
+ catch(_com_error &e) {
+ throw ADOException("MSSQL can't create " + name, e);
+ }
}
void