Latest update change with DatabaseContext?

7.2.5.2 x64 windows10
Latest version seems nice. But my SQL calls through DatabaseContext now all fail.
I have been using this just fine for months…

function DoSQL(strSQL as string) as variant
Dim Context as object, DataSource as object, Conn as object, Stmt as object, myType as string
if NOT(globalLibreActivationdone) then exit function
if len(strSQL) < 1 then exit function
on error goto handle
Context=CreateUnoService(“com.sun.star.sdb.DatabaseContext”) '< get the database context
DataSource = Context.getByName(“MyDataBase”) REM resolve system name for database as it resides in system stucture
Conn=DataSource.getConnection("","") REM acquire an active connection (username & password pair - HSQL default blank)
Stmt=Conn.createStatement()
if instr(strSQL,“Q*”) >0 then
strSQL = mid(strSQL,3)
say(“Doing Special QUERY:” & strSQL)
DoSQL = Stmt.executequery(strSQL) '<- run the SQL command
else
say(“RUNNING SQL:” & strSQL)
DoSQL = Stmt.executeupdate(strSQL) '<- run the SQL command
endif
DoSQL= Error
Conn.close() '<- close the db connection
exit function
handle:
DoSQL = Error 'return error information
if err <> 1 then say(“Problem in DoSql:” & err & chr(13) & Error)
end function

But now it does not find my database in the context.getbyname line. And all of my SQL fails completely. Has the structure of this linkage changed with this newest version?

Hello,
Based upon previous question/sample you provided, this line:

DataSource = Context.getByName(“MyDataBase”)

.
was
.

DataSource = Context.getByName(“4thImpact”)

.
Now if you changed the name, you need to register the new name.
.
The registered names will also be erased if you erase the user profile.
.
Bottom line is the name you are using is not registered.

Hi! Well, you are right. But I did not change the name. Only changed it here in my topic…it is actually still 4thImpact. But maybe re-registering it will help. Though i forgot where you do that now…ah…found it!

From menu, Tools>Options. Then under LibreOffice Base>Databases. Registered DBs then in right panel.

If registered, re-registering will not be of any help. If the name is there but the location is different, then delete the old & create new.

Thanks! Though i can’t help but wonder if a lot of peeps will run into this same thing…but maybe they mostly already know exactly where to fix it…

The update destroyed (parts of) your user profile where all the settings are stored including your registered data sources. Directory %APPDATA%\LibreOffice\4\user is the place where your settings, macros, extensions, templates, dictionaries, galleries, auto-texts and whatnot is stored.

yes…took quite a while to restore all of my preferences. hope there are no further ramifications. Thanks for the info. Man, i wish the chat/help website for Unity was as good as this one. Questions there just sit for years!!!

Can you explain to me why most (private) Windows users never use any backup software? SInce 20 years I use Linux and I can still find configurations, test files and scripts that are 20 years old. For the current system I can restore any state of the past 6 months.

well, in this case…i have no idea what file in my libre system i would need to backup to save all of those preferences. and, oddly, the preferences that annoy me the most don’t even seem to be selectable. or, i can’t find the option for it if it is. whenever i go into edit mode on a form i want full screen and no rulers but it always comes up windowed with rulers…hmmmm… the option has got to be here someplace… ha ha ha ha!

Hello,
The specific directory to back up was noted in a previous comment but I believe the question is more general - Backups of your system.
.
But my comment here is about your request - full screen edit without rulers. Can do with macro attached to Open Document event. This (except for rulers) has been posted here before. Code:

Sub FullScreen
    If NOT thisComponent.CurrentController.isFormDesignMode Then Exit Sub
    document   = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    dispatcher.executeDispatch(document, ".uno:Ruler", "", 0, Array())
    oDoc = ThisComponent   
    oDocCtrl = oDoc.getCurrentController()
    oDocFrame = oDocCtrl.getFrame()
    cDispatchUrl = ".uno:FullScreen"
    oDispatchHelper = createUnoService( "com.sun.star.frame.DispatchHelper" )
    oDispatchHelper.executeDispatch( oDocFrame, cDispatchUrl, "", 0, Array() )
End Sub 

i find a system backup of windows to be pointless and rather just back up my data. When windows screws up it’s a good idea to reinstall it anyway. But that would not help in this case where the libre system threw out all of my personal preferences. no biggie, but thanks for the macro to turn off rulers and maximize window! Wow, that’s a whole new world to have edit events. Being as it IS a document it actually makes perfect sense…but i never put 2 and 2 together. Would have taken me weeks to figure out that object control chain!

Yeah…that’s because Linux works…windows really does not quite often.

So do I. The system including most of the installed software is recoverable or replacable within 2 hours. The thing is that I backup only my home directory which includes all user data including the user specific configurations for each and every appllication. Linix has no registry. There is no %APPDATA% folder nor special folders for particular applications. Every application is forced to store all of its user data in some hidden files within the home folder. There is no other place with write permission where a user app could store data permanently.
The Windows file system and registry is complicated but I would think that there must be some well known backup strategies for this operating system including things like %APPDATA% and the user relevant branches of the registry. It works fairly well (not perfectly) on a Windows network with roaming user profiles, so there must be some way to backup all user data consistently.

Prior to Linux being my primary OS, I used software to backup the Windows system (name eludes me now). This copy of the OS allowed me to restore the entire system to either the current or another drive. But more importantly I could mount the backup and restore any file or files to any location. Acronis may have that capability currently.