Ask Your Question
0

[Closed] Can't remove password from LO Base connected to MySQL [closed]

asked 2017-11-16 16:53:34 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi, I have a database created on MySQL workbench that runs on my company server and I connected it to Base using this connector here https://extensions.openoffice.org/en/... .

I have several users (6 for now, but i plan on adding some more) and i didn't have any problem whatsoever. Today i tried removing the password from every user login autentication but it didn't work. In the mysql workbench i removed the password (and i see the warning "no password" so i think it worked just fine) and in the base .obd file i unchecked the option "password required". When i try to acces the database it asks me for the password, I just press OK since there is no password to insert but then i get the error "Impossible creating the link to the "augeo" data source. User and password are mandatory" (i ruffly translated it from italian, sorry).

I already tried modifying the content.xml file as it's said in this discussion here https://ask.libreoffice.org/en/questi... but it didnt' work, it still gives me the same error as before, the only difference is that now it doen't even ask me for the user login, it just gives me the error . I tried changing the connection, without the connector and with the direct connection but i still have the same error. Do you have any solution for this?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Asia
close date 2017-11-22 10:56:09.162057

1 Answer

Sort by » oldest newest most voted
0

answered 2017-11-16 18:04:35 +0200

Ratslinger gravatar image

Hello,

First let me state I don't condone removing passwords as they are a method of protection for you and the company.

There are two methods which you can use. The actual method you are using will work using a JDBC driver from Oracle (obtained here). I just tested using connector v5.1.42 and it accepts a blank password. Conversly, as your question states, using a Native connector (SDBC) it always states password is required.

As a second option, without changing connectors, you can bypass the login dialog completely and leave the server password intact. This can be done with a macro tied to the Open Document event of the .odb file:

Sub AuthenticationTest
  dim sURL as string
  dim oArgs(0) As New com.sun.star.beans.PropertyValue
  dim oDocStatus as object
  dim oihandler
  oihandler = CreateUnoListener("InteractionHandler_", "com.sun.star.task.XInteractionHandler")
  sURL = "file:///home/YOUR_PATH_HERE/YOUR_FILE_NAME_HERE.odb"
  oArgs(0).Name = "InteractionHandler"
  oArgs(0).Value = oihandler
  oDocStatus = StarDesktop.loadComponentFromURL(sURL, "_default", 0, oArgs)
  oDocStatus.DataSource.Password = "LOGIN_PASSWORD_HERE"
  oDocStatus.setModified(0)
End Sub

You just need to place the relative information in the two lines of code for .odb path & user password.

If this answers your question please click on the ✔ (upper left area of answer).

edit flag offensive delete link more

Comments

Hi, I tried writing the macro but it didn't work ... I still get the same error. Do I need to create the macro in a specific folder? I placed it in my odb file folder. Is it maybe because in our company we have a folder redirection for every computer? So the .odb file isn't really on the :C of the computer but on the server.

Asia gravatar imageAsia ( 2017-11-17 14:52:09 +0200 )edit

The macro doesn't go in a folder but in the .odb macro section. Did you attach it to the Open Document event of the .odb? Did you change the code for the .odb location & password? How to use macros can be found in the LO documentation, Chapter 9 - Macros; click here. Have tested this code and it works.

Ratslinger gravatar imageRatslinger ( 2017-11-17 15:37:16 +0200 )edit

yes i changed the location and password and yes i attached the open document event. I can see the the program trying to load something but it gets stuck. Maybe I just wrote the wrong url in the sURL field? I uploaded the image of the .odb file properties, in which you can see the url of the file and the macros with my changes... https://photos.app.goo.gl/siResDws405...

Asia gravatar imageAsia ( 2017-11-17 16:20:28 +0200 )edit

@Asia Sorry for the confusion but your first comment read totally different from your last explanation. I don't have a way to test with the setup you have but the URL you have doesn't appear correct. Try replacing the 'sURL' line with this:

sURL = ConvertToURL("\\AUGEOSRV01\Folder Redirection\Stagista\Desktop\Augeo 1.0 MySQL.odb")
Ratslinger gravatar imageRatslinger ( 2017-11-17 17:18:34 +0200 )edit

Just to be certain we're on the same page, the Open Document event referred to is for the .odb main screen and not for a Form.

Ratslinger gravatar imageRatslinger ( 2017-11-17 17:42:04 +0200 )edit

Thank you very much! It fixed the problem! I will close this question.

Asia gravatar imageAsia ( 2017-11-22 10:53:22 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-16 16:53:34 +0200

Seen: 48 times

Last updated: Nov 22 '17