User: kz      
Date: 05/01/21 09:20:55

Modified:
 /dba/dbaccess/source/ui/misc/
  dsntypes.cxx

Log:
 INTEGRATION: CWS dba22 (1.22.4); FILE MERGED
 2005/01/07 06:36:37 oj 1.22.4.2: #i39504# set _sDatabaseName correctly
 2005/01/04 12:11:43 oj 1.22.4.1: #i39873# check if driver for embedded object 
can loaded

File Changes:

Directory: /dba/dbaccess/source/ui/misc/
========================================

File [changed]: dsntypes.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/dsntypes.cxx?r1=1.22&r2=1.23
Delta lines:  +19 -5
--------------------
--- dsntypes.cxx        22 Nov 2004 15:05:55 -0000      1.22
+++ dsntypes.cxx        21 Jan 2005 17:20:52 -0000      1.23
@@ -91,6 +91,12 @@
 #include <osl/file.hxx>
 #endif
 // ---
+#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_ 
+#include <com/sun/star/sdbc/XDriverAccess.hpp>
+#endif
+#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
+#include "dbustrings.hrc"
+#endif
 //.........................................................................
 namespace dbaui
 {
@@ -99,6 +105,7 @@
        using namespace ::com::sun::star::uno;
        using namespace ::com::sun::star::beans;
        using namespace ::com::sun::star::lang;
+    using namespace ::com::sun::star::sdbc;
 
        namespace 
        {
@@ -330,7 +337,7 @@
                        }
                        if ( _rsHostname.Len() )
                                _rsHostname = 
_rsHostname.GetToken(_rsHostname.GetTokenCount('@') - 1,'@');
-                       _rsHostname = sUrl.GetToken(sUrl.GetTokenCount(':') - 
1,':');
+                       _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount(':') 
- 1,':');
                        break;
                case DST_LDAP:
                        
lcl_extractHostAndPort(sUrl,_sDatabaseName,_nPortNumber);
@@ -616,7 +623,14 @@
        DATASOURCE_TYPE eRet = DST_DBASE;
        ::utl::OConfigurationNode aEmbeddedDatabase = 
lcl_getEmbeddedDatabase(_rxORB);
        if ( aEmbeddedDatabase.isValid() )
+    {
+        ::rtl::OUString sURLPrefix = getEmbeddedDatabaseURL(_rxORB);
+        Reference< XDriverAccess > 
xDriverManager(_rxORB->createInstance(SERVICE_SDBC_DRIVERMANAGER), UNO_QUERY);
+        if ( xDriverManager.is() && 
xDriverManager->getDriverByURL(sURLPrefix).is() )
+        {
                eRet = DST_EMBEDDED;
+        }
+    }
        return eRet;
 }
 // 
-----------------------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to