Hi Ocke,
the code you are searching for, if I get you right is
dba/dbaccess/source/core/dataaccess/datasource.cxx
I saw those two PropertyValues (URL and Storage) in the code but am
wondering if there is a simple way to override them. Can you hard-code
them into your .odb content.xml? I tried are few different places
(including the datasource registry entries) but wasn't successful. Could
they be updated with a macro? Or maybe a dialog where we can edit the
drivers properties as returned by getPropertyInfo()?
I'm trying to avoid having to set up a build environment if at all
possible ;)
Cheers,
Roger
PS What is the 'Storage' PropertyValue for?
if ( m_pImpl->isEmbeddedDatabase() )
{
sal_Int32 nCount = aDriverInfo.getLength();
aDriverInfo.realloc(nCount + 2 );
aDriverInfo[nCount].Name =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
aDriverInfo[nCount++].Value <<= m_pImpl->getURL();
aDriverInfo[nCount].Name =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"));
Reference< css::document::XDocumentSubStorageSupplier>
xDocSup( m_pImpl->getDocumentSubStorageSupplier() );
aDriverInfo[nCount++].Value <<=
xDocSup->getDocumentSubStorage(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")),ElementModes::READWRITE);
}
You could set some extra properties to let the driver know where to find
the database file.
I hope this helps.
Best regards,
Ocke
Roger Keays wrote:
Hi there,
I am looking for a neat way to separate database frontend & backend
while making it as simple as possible to distribute the product. i.e:
* the backend must be file based
* the backend is preferrably a single file
* the end user only needs to have OOo 2
* there is no loss of OOo features by the chosen database
I've investigated many different options but I think the best solution
would be to use OOo's native hysqldb as the backend, but packaged as a
separate .odb file. I like this idea because OOo comes with the
hysqldb drivers and hysqldb has very closely mapped JDBC data types (a
development preference).
You can, of course, already do this by using a JDBC backend with the
hysqldb driver but there are a few niggling caveats:
* you can't alter columns with the JDBC bridge (annoying for dev)
* hsqldb generates a number of files for a single database
* the user needs to issue an SQL SHUTDOWN before closing the db
Now... OOo also comes with a SDBC driver for hsqldb right? If I could
figure out how to reuse this I think at least the first two problems
would be solved. Following the instructions at
http://dba.openoffice.org/howto/UserDefinedDriverUI.html it's possible
to connect to an sdbc:embedded:hsqldb, but I can't see any way to
specify a filename which indicates where the database is embedded.
Would this be possible without any changes to the OOo source?
Alternatively, how difficult would it be to write an additional
hysqldb SDBC driver (or patch the existing one) to allow the filename
to be specified?
Thanks in advance,
Roger
--
----------------------------------------
Ninth Avenue Software
p: +61 7 3870 8494 (UTC +10)
f: +61 7 3870 8491
w: http://www.ninthavenue.com.au
e: [EMAIL PROTECTED]
----------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]