[Solved] Connection to data source could not be established

Discuss the database features
Post Reply
BrianBonzo
Posts: 6
Joined: Sun Oct 08, 2017 6:20 am

[Solved] Connection to data source could not be established

Post by BrianBonzo »

Yesterday was working away very happily in base, closed the program and went to bed. The next day open my file but with no tables, forms or queries there. Clicked on tables and I got the error message "connection to the data source could not be established". I also noted that along the bottom of the window that HSQL had been replaced with JDBC (I think).

Searched the web but found no solution. Please help! Is all my data now lost? :(
Last edited by Hagar Delest on Thu Oct 12, 2017 9:59 pm, edited 1 time in total.
Reason: tagged [Solved].
BrianBonzo
Posts: 6
Joined: Sun Oct 08, 2017 6:20 am

Re: The connection to the data source could not be establish

Post by BrianBonzo »

Update - Reinstalled open office, reinstalled JRE 32 bit but still same problem.

I think the real issue is that along the base of the window embedded database and HSQL have for some unknown reason has been replaced by JDBC JDBC so hence the connectivity problem. The issue is how do I change JDBC JDBC back to embedded and the HSQL database engine?

Any help would be really appreciated. Thanks.
Open Office 4.1.3 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: The connection to the data source could not be establish

Post by Villeroy »

[Python] Macro to extract and reconnect embedded HSQLDB
Now there is also a "Revert_To_Embedded" routine which can be used to reconnect the document to its embedded HSQLDB if it exists within the document container.
If the embedded db is still intact, I would definitively go for the stand-alone database. It is much more stable and the office suite can't kill the whole db anymore.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
BrianBonzo
Posts: 6
Joined: Sun Oct 08, 2017 6:20 am

Re: The connection to the data source could not be establish

Post by BrianBonzo »

Thanks a million for your post. Used the python module as you suggested and EXCELLENT at least got my tables back but no queries or forms. How do I get these back? Thanks, Brian :)
Open Office 4.1.3 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: The connection to the data source could not be establish

Post by Villeroy »

BrianBonzo wrote:Thanks a million for your post. Used the python module as you suggested and EXCELLENT at least got my tables back but no queries or forms. How do I get these back? Thanks, Brian :)
I guess your database document crashed and it was pure luck that your embedded database remained intact. I would expect that any modifications of the last session are lost. I can't tell anything about queries and forms. For any productive work regular backups are a matter of course. With Base you should use external databases rather than embedded ones. When you open an embedded database it is "installed" into a temporary directory and used like an external database. When you quit editing data, the database is wrapped back into the Base document. The constant wrapping and unwrapping of a potentially huge database is problematic.

If you have some older backup document with the forms and queries:
1) Extract your embedded database from the fixed document. You have a macro that is able to do that.
2) Rename the fixed document and restore a database document with forms and queries from a backup. Store the backup copy where the fixed document used to be.
3) Open the database with forms and queries and run the macro again. When prompted how to proceed, choose the option to connect the current database document with the already existing external database (no extraction, keep existing files and connect).

Now you have the old backup document connected with the database of the fixed document.

Alternatively you can use my FreeHSQL tool. It provides a little GUI which allows you to connect any existing database document in any folder with an external HSQLDB in any other folder and regardless of the file name. The simple Python macro assumes equal base names in subdirectory "database".
 Edit: P.S. Your odb file is a zip archive. Query strings are stored in content.xml. Forms are stored in a subfolder with a corresponding entry in content.xml. 
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
BrianBonzo
Posts: 6
Joined: Sun Oct 08, 2017 6:20 am

Re: The connection to the data source could not be establish

Post by BrianBonzo »

Unfortunately I did not make a backup of my odb. Silly me!!!!!!!!!!!!!!!!!!
Open Office 4.1.3 on Windows 10
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: The connection to the data source could not be establish

Post by UnklDonald418 »

Go to Tools->Options->Open Office->Paths to find the path to where automatic Backups are stored.
With a little luck there might be something there.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
BrianBonzo
Posts: 6
Joined: Sun Oct 08, 2017 6:20 am

Re: The connection to the data source could not be establish

Post by BrianBonzo »

You are both a genius and my savior. Found a 8 day old auto backup with my forms and queries intact. Data was a bit out of date though. So now I have an odb with external database and all data current, then an old embedded database odb but with the correct Forms and Queries. Now need my Forms with the current data. How best can I do this?

I must admit I was seriously thinking of giving up on Open Office base but now my faith has been restored somewhat by two excellent Forum members. Thanks to you both.
Open Office 4.1.3 on Windows 10
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: The connection to the data source could not be establish

Post by UnklDonald418 »

To copy a Form just click on the Form in your embedded database and drag it into the Forms area on the external database. It works the same with Queries and Reports.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
BrianBonzo
Posts: 6
Joined: Sun Oct 08, 2017 6:20 am

Re: The connection to the data source could not be establish

Post by BrianBonzo »

:bravo: SOLVED Up and running again thanks to Forum help. Much appreciated.
Open Office 4.1.3 on Windows 10
Post Reply