Bug Hunting Session
Bug 61972 - FILEOPEN: ENHANCEMENT - Support reference to document directory for back end database location
Summary: FILEOPEN: ENHANCEMENT - Support reference to document directory for back end ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Import
  Show dependency treegraph
 
Reported: 2013-03-07 16:36 UTC by Kurt
Modified: 2017-11-02 23:14 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt 2013-03-07 16:36:00 UTC
BACKGROUND:
Whenever Base is attached to an external database, the exact path of the external database file must be specified.  Because this is likely to be unique to the filesystem structure on each user's hard drive, it makes it difficult to distribute split databases to other potential users.  Each end user must be educated enough to edit the Base document's connection settings to connect to the back end database.

I propose a mechanism where the current Base document's directory could be specified as the location of the back-end database.  This way as long as a back-end database file and the front end Base document file are kept together, there won't be any need for end users to edit connection settings, no matter what the filesystem structure is or if the files are later moved.

IMPLEMENTATION:
I propose two implementations depending on whether the back-end database is directly supported by Base (MS Access, MS Access 2007, Spreadsheet, dBase), or if it's based on a connection string like ADO, ODBC, and JDBC.

For file-based external back-end databases that are supported directly by LO(MS Access, MS Access 2007, Spreadsheet, dBase), you specify where the back-end database file is using a standard file requester dialog.  I propose that after the user clicks "Ok" on this, that LO Base should detect if the selected file is in the same directory as the current document.  If it is, then have Base automatically add an internal flag to the Base document that tells Base to , in the future, always look for the database file first in the Base document's directory.  The full path of the database file will still be stored, so that in the future if the user moves the Base document but not the back-end database file, then Base can still look there for it.

For connection-string based back-end databases (ADO, ODBC, JDBC), I propose supporting an environment-variable-like macro expansion in the connection string where, for example, %DOCUDIR% expands to be the full patch directory of the current Base document.  Thus, a JDBC connection string could be: "jdbc:sqlite:%DOCUDIR%/database.db"
Comment 1 Joel Madero 2013-12-28 18:15:46 UTC
Lionel - one of yours, mind commenting?
Comment 2 Alex Thurgood 2014-10-20 08:17:39 UTC
Sounds like a useful enhancement request to me, especially for admins. Whether or not it is feasible, I have no idea. Confirming as rfe.
Comment 3 Alex Thurgood 2015-01-03 17:41:09 UTC Comment hidden (no-value)
Comment 4 Roberto 2016-01-22 23:28:52 UTC
Probably related to bug 97330.