On 12/29/2014 05:29 AM, Fernand Vanrie [via Document Foundation Mail
Archive] wrote:
>
>> I am running LibreOffice 4.3.4.1 on Fedora 21. I'm trying to run a
>> LibreOffice basic macro from a form using the mysql direct connect. I am
>> able to open tables in the database without any problem.
>>
>> When I open the form, the database password is requested and I enter it, and
>> the form's grid is loaded with the data. I'm having trouble connecting from
>> the form using a basic macro. The connection requires a password. Running
>> the following code produces an error at the getConnection statement:
>>
>> sURL = "sdbc:mysql:mysqlc:sys76.localdomain:3306/folding"
>> oManager = CreateUnoService("com.sun.star.sdbc.DriverManager")
>
> trye someting like (not sure about your username)
>
>
>
> Dim oParms(1) as new com.sun.star.beans.PropertyValue
> oParms(0).Name = "user"
> oParms(0).Value = "[email protected] "
> oParms(1).Name = "password"
> oParms(1).Value = "yourpassword"
> oManager = CreateUnoService("com.sun.star.sdbc.DriverManager")
>
> oCon = oManager.getConnectionWithInfo(sURL, oParms())
>
> getConnectionWithParameters() = oCon
>
> hope it helps
>
> Fernand
>
>
>> oCon = oManager.getConnection(sURL)
>>
>> The resulting error is:
>>
>> BASIC runtime error.
>> An exception occurred
>> Type: com.sun.star.sdbc.SQLException
>> Message: Access denied for user 'craig'@'mac.localdomain' (using password:
>> NO).
>>
Fernand,
Thanks for your reply. This solves my problem.
Craig
--
View this message in context:
http://nabble.documentfoundation.org/Re-SOLVED-mySQL-login-from-a-form-using-direct-connect-tp4134385.html
Sent from the Users mailing list archive at Nabble.com.
--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted