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

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 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 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

Sort by » oldest newest most voted

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
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.setModified(0)
End Sub


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

more

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.

( 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.

( 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...

( 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")

( 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.

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

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

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