Hey Fernand,
thank you for your answer. Yes, this way works and I try this before,
but I work on a customer extension and this is the "badest option". What
I did not understand is why it was working last week but not this week??
And why in any case the error-massage returns localhost (127.0.0.1)?
By the way: inserting data-rows in different tables with forein keys
seems to be a little bit "tricky"? To get the index (primery key) of the
just inserted row I tried to use "select from <table>
last_inserted_id()", but unfortunatly it does not work.
So I insert first a unigue string in a special field and use afterwards
a "select id from <table> where <field>='string'"
Then I complete the datarow and write afterwards the dependend rows to
other tables - not really perform.
How are you doing this job?
best regards
Thomas
Fernand Vanrie schrieb:
> Thomas ,
>
> To avoid problems like you desribed we nowadays uses the
> "com.sun.star.sdb.DatabaseContext" as a "binding" point to our MySQL server.
> So we place a OO-DB-document where all OO- users can acces the document
> with the lowest posible rights ( to avoid unwanted acces to the MySQL
> Tables)
> The we declare this DB-doc as a database in OO with a stadard name like
> "mysql_native"
> For connecting we uses in our macro's:
>
> oDB = CreateUnoService("com.sun.star.sdb.DatabaseContext")
> oConn =
> oDB.GetByName("mysql_native").GetConnection("username","password")
>
> We change "username" and "password" in our macro's (who are scrambled)
> depending on the aplication needs
> This aproach has also the advantage that you can make MySQL data
> available in the Beamer (Datasource browser)
>
> Hope it helps
--
## Marketing deutschsprachiges Projekt
## http://de.openoffice.org - www.openoffice.org
## Vorstand OpenOffice.org Deutschland e.V.
## Mitglieder willkommen: www.OOoDeV.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]