Database registration gets lost

Discuss the database features

Database registration gets lost

Postby DTC57 » Thu Oct 19, 2017 11:07 am

I have a Base database linked to a Calc spreadsheet (pivot table). This works fine on one computer (Windows 10), but on another (Windows 7), the database registration settings get lost. What could the problem be?

Many thanks, David
OpenOffice 4.1.3 on Windows 10
DTC57
 
Posts: 4
Joined: Tue Oct 17, 2017 3:50 pm

Re: Database registration gets lost

Postby Villeroy » Thu Oct 19, 2017 11:33 am

[Spreadsheet] --> [Base document] --> [other documents]

The connection from a spreadsheet to Base is stored relatively in the Base document. When you copy both files to the other system so their relative path to each other remains the same, everything works fine. In the database menu:Edit>Database>Connection... lets you change the path. The path is also displayed in the status bar of the database document.

The second connection from Base to any other document (the registration) is stored absolutely in the user's profile folder. You can change it via menu:Tools>Options>Base>Databases
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24584
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Database registration gets lost

Postby DTC57 » Thu Oct 19, 2017 12:52 pm

The relative paths are indeed the same. I copide the two files together from the Windows 10 machine to the Windows 7 one. The problem is a different one. When I add the database under the registered paths (options), the setting seems to get lost, so that the spreadsheet does not find the database file, since the registration setting gets lost. Any idea what could be the problem on the Windows 7 machine?
OpenOffice 4.1.3 on Windows 10
DTC57
 
Posts: 4
Joined: Tue Oct 17, 2017 3:50 pm

Re: Database registration gets lost

Postby Villeroy » Thu Oct 19, 2017 2:55 pm

If you want the same templates, macros, auto text, dictionaries, database registrations and overall settings on both machines, you should copy the user profile folder %APPDATA%\OpenOffice\4\user
Before doing that, make a backup of the old user profile on the target machine.
However, it possible that the database paths of the database registrations are different on two Windows machines. They could be the same for the same user name.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24584
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Database registration gets lost

Postby Villeroy » Fri Oct 20, 2017 3:10 am

Store the database document in a trusted directory according to Tools>Options>Security>[Macro Security]
Store the macro in the database document.
Adjust constant cRegName to your needs.
Call Tools>Customize>Events while your database is the active document.
Save in: <your database document>
Assign the database document's "Open Document" event to the macro.
Code: Select all   Expand viewCollapse view
Sub setupDBRegistration()

Const cRegName = "My Database"

sDocURL = ThisDatabaseDocument.getURL()
oRegSrv = createUnoService("com.sun.star.sdb.DatabaseContext")
oRegSrv.registerDatabaseLocation(cRegName, sDocURL)
End Sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24584
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Base

Who is online

Users browsing this forum: No registered users and 6 guests