OK i learned a bit more :
lets starts with geting a connection (here I make a connection to a odbc
driver whos gives me acces to a MS SQL database)
sURL = "sdbc:odbc:debiteuren"
oManager = CreateUnoService("com.sun.star.sdbc.DriverManager")
oCon = oManager.getConnection(sURL)
I have one native OO-basedocument with 2 Formdocs who uses the same
internal HSQL databse engine
the goal is to use Switchboard to give users acces to all my forms and
keep them away from the databsestuff
in Formdoc1 I have oForm who is the mainform for some Subforms who
must/can use my "oCon"
in FormDoc2 I have oFom2 as a mainform who also must use my "oCon"
We can not uses "oCon" to set a ActiveConnection in a already opened form.
oForm.ActiveConnection = oCon >>>>>gives a error (propertyVeto....)
First we have to open a form with "loadComponentFromURL" who accept oCon
as argument.
Now I have a "open" oform with right "ActiveConnection" but the
subforms are not knowing about this connection. The good news is that
we can pass the "ActiveConnection" to the subforms
oSubForm.ActiveConnection = oForm.ActiveConnection
be carfull to check that the form is not opened in "designMode" the
trick is only working when opened in "open" mode !!!
BUT !!!!!it is tnot possible to passing my "oCon" to the other oform2
who is located in a other fromdocument
oform2.activeConnection = oform.activeConnection >>>>>gives a error
(propertyVeto....)
are my assumptions correct or a i missing something ?
Thanks
Fernand
Fernand Vanrie wrote:
Here we arae again :-)
I can pass a new connection to a Form present in a base Doc using
"loadComponentFromURL" where the nwe connection is passed as a
argrument . but for the the SubForms present in this loaded Form i
find no longer a "formcontainer who supports "loadComponentFromUR"
and anyhow this forms are "loaded but with no Active connection or
the Active connection who was present in the oriinal Base Doc. In
other words the sub forms are not aware of the new connection in the
main Form.
So: again :-) how to change the activeConnection in a SubForm
Thanks for any hint
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org