summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-01-08 11:02:32 +0100
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-01-08 11:02:32 +0100
commitd3a4501c36c893751070c20e5a6462261269668b (patch)
tree89f0d8e3da89a4b5bcc8687c1dfa1f0664b37c85 /dbaccess/source
parent58519fbb7255ca48701d3850f4038ca549e29b27 (diff)
dba33e: #i108128# check if default driver is available
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx9
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.hxx1
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx2
3 files changed, 9 insertions, 3 deletions
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index dd7e736240ec..fd62eba4ff5f 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -356,6 +356,11 @@ void ODbDataSourceAdministrationHelper::clearPassword()
// -----------------------------------------------------------------------------
Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver()
{
+ return getDriver(getConnectionURL());
+}
+// -----------------------------------------------------------------------------
+Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::OUString& _sURL)
+{
// get the global DriverManager
Reference< XDriverAccess > xDriverManager;
String sCurrentActionError = String(ModuleRes(STR_COULDNOTCREATE_DRIVERMANAGER));
@@ -376,11 +381,11 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver()
throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any());
- Reference< XDriver > xDriver = xDriverManager->getDriverByURL(getConnectionURL());
+ Reference< XDriver > xDriver = xDriverManager->getDriverByURL(_sURL);
if (!xDriver.is())
{
sCurrentActionError = String(ModuleRes(STR_NOREGISTEREDDRIVER));
- sCurrentActionError.SearchAndReplaceAscii("#connurl#", getConnectionURL());
+ sCurrentActionError.SearchAndReplaceAscii("#connurl#", _sURL);
// will be caught and translated into an SQLContext exception
throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any());
}
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
index a194ebc7b23c..6c64363a1623 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
@@ -140,6 +140,7 @@ namespace dbaui
/** return the corresponding driver for the selected URL
*/
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(const ::rtl::OUString& _sURL);
/** returns the data source the dialog is currently working with
*/
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index bab1dcca3694..ced0640b928c 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -945,7 +945,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
{
::rtl::OUString sEmbeddedURL = m_pCollection->getEmbeddedDatabase();
::connectivity::DriversConfig aDriverConfig(getORB());
- if ( !aDriverConfig.getDriverFactoryName(sEmbeddedURL).getLength() )
+ if ( !aDriverConfig.getDriverFactoryName(sEmbeddedURL).getLength() || m_pImpl->getDriver(sEmbeddedURL).is() )
sEmbeddedURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:"));
return sEmbeddedURL;