Bug 44069

Summary: Request: Environment-variable like macros for ODBC/ADO/JDBC connection strings
Product: LibreOffice Reporter: Kurt <kurt.fitzner>
Component: BaseAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: iplaw67, kurt.fitzner, lionel, sasha.libreoffice
Priority: medium    
Version: Master old -3.6   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 104790    

Description Kurt 2011-12-22 10:09:39 UTC
Deploying a file-based Base database that doesn't use the internal HSQLDB connection can be difficult.  The connection string for external databases normally requires a full path to the database, DSN file, or similar.  Being that different users can deploy the databases to different directories, and even to different platforms, this requires manual configuration by the user of sometimes esoteric database settings.

For example, a Base database I recently deployed connects to a SQLite database.  I used a DSN-less ODBC connection so the end user didn't have to create an ODBC DSN to use the database.  However I still had to use Base's ODBC "Optional Settings" to specify the database file by setting it to:
  "Database=C:\Users\Kurt\Documents\Creative\Pathfinder Spell Database.db".

The end user doesn't have to create a DSN, but the user does have to edit the Base database connection to edit the ODBC "Optional Settings" to give the location on the user's system of the back-end SQLite database.

I propose inclusion of a system similar to environment variables that will allow inclusion of "macros" in connection strings that expand to different things.  In the above example, the ODBC "Optional Settings" might read:
  "Database=%DOCPATH%\Pathfinder Spell Database.db"

In the above example, "%DOCPATH%" would be evaluated by LibreOffice and expand to the directory that the document resides in.  This will allow a database to be deployed where, if the database file is kept in the same directory as the Base .odb document, the user doesn't have to do anything extra to connect to the database file.
Comment 1 sasha.libreoffice 2012-05-02 08:18:39 UTC
Thanks for new idea
> if the database file is kept in the same directory as the
> Base .odb document, the user doesn't have to do anything extra to connect to
> the database file.
May be allowed relative path like this:
./Pathfinder Spell Database.db
inside of odb file. And if not allowed, may be it is a bug?
And may be possible to place file-based-database into odb file (embed)? Especially if database file is small, it would be more simply for user to use such all-in-one odb.
Comment 2 Alex Thurgood 2015-01-03 17:40:52 UTC
Adding self to CC if not already on