On 2/14/07, Frank Schönheit - Sun Microsystems Germany
<[EMAIL PROTECTED]> wrote:
Hi Matthias,

> For policy reasons we want to prevent users from storing data directly
> inside ODB files. But we want to retain all of OpenOffice.org features
> for other database types that use external storage. Does anyone have
> an idea how we can achieve this?

Try removing the hsqldb2.dll (resp. libhsqldb2.so) library from the
installation. This is the driver which implements the embedded database.

Okay. That's a piece of information I've been missing. I checked the
Dev Guide but didn't find HSQL listed in the table of drivers and
since the table is prefixed with "Below is a list of all available
drivers." I concluded that storing data directly in ODB files is
special functionality implemented outside of the standard driver
framework. I think I'll file an issue for that omission.

The cleaner solution would be to de-register this driver at the global
service manager. This is needed once, and should be possible with a
Basic macro, but I don't have any code at hand.

The following code will do it
-----------------
Dim oPathSubst as Object
oPathSubst = createUnoService( "com.sun.star.util.PathSubstitution" )
Dim sRegistryLocation As String
sRegistryLocation = oPathSubst.substituteVariables( _
"$(prog)/services.rdb", true )
Dim oRegistry as Object
oRegistry = createUnoService( "com.sun.star.registry.SimpleRegistry" )
oRegistry.open( sRegistryLocation, false, false )
Dim oKey as Object
oKey = oRegistry.getRootKey()
oKey.deleteKey("/IMPLEMENTATIONS/com.sun.star.sdbcx.comp.hsqldb.Driver")
oRegistry.close()
----------------------

However, after executing this code, regview services.rdb still lists
hsql in the instances listed below in the SERVICES subtree. So the
removal is not complete, which I assume will have unwanted side
effects. What do I have to do to get rid of these entries, too?

/ com.sun.star.sdbc.Driver
    Value: Type = RG_VALUETYPE_STRINGLIST
           Size = 416
           Len  = 10
           Data = 0 = "com.sun.star.comp.sdbc.calc.ODriver"
                  1 = "com.sun.star.comp.sdbc.ODBCDriver"
                  2 = "org.openoffice.comp.drivers.MySQL.Driver"
                  3 = "com.sun.star.comp.sdbc.MozabDriver"
                  4 = "com.sun.star.sdbcx.comp.hsqldb.Driver"
                  5 = "com.sun.star.comp.sdbc.JDBCDriver"
                  6 = "com.sun.star.comp.sdbc.flat.ODriver"
                  7 = "com.sun.star.comp.sdbc.evoab.OEvoabDriver"
                  8 = "com.sun.star.comp.sdbc.dbase.ODriver"
                  9 = "com.sun.star.comp.sdbcx.adabas.ODriver"

/ com.sun.star.sdbcx.Driver
    Value: Type = RG_VALUETYPE_STRINGLIST
           Size = 301
           Len  = 7
           Data = 0 = "com.sun.star.comp.sdbc.calc.ODriver"
                  1 = "org.openoffice.comp.drivers.MySQL.Driver"
                  2 = "com.sun.star.sdbcx.comp.hsqldb.Driver"
                  3 = "com.sun.star.comp.sdbc.flat.ODriver"
                  4 = "com.sun.star.comp.sdbc.evoab.OEvoabDriver"
                  5 = "com.sun.star.comp.sdbc.dbase.ODriver"
                  6 = "com.sun.star.comp.sdbcx.adabas.ODriver"

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

Reply via email to