Bonjour Frank
Message du 2006-03-14 12:37:
Hi Laurent,

in fact, what about the datasource that seems to load the file without displaying it as frank said

We then end with 2 "loads" of the document
one for the datasource ( maSource.DatabaseDocument)
one for the loadComponentFromURL

Effectively, it's loaded once only, but you have two clients of it: the
script which (implicitly) loaded it via maSource.DatabaseDocument, and
the user (or script) which (explicitly) loaded it.

That's why it's hard to tell who has the ownership of the document.

In the original code, I can understand that, although it is not obvious.
But if I directly load the odb file, I still get the same exception

Dim dbDoc As Object
Dim adrOdb As String
Dim OdbOpt() as new com.sun.star.beans.PropertyValue

adrOdb = convertToURL("C:\Documents and Settings\Personne\Mes documents\Databases\base2\usine.odb")
dbDoc = StarDesktop.loadComponentFromURL(adrOdb, "_blank", 0, OdbOpt())
wait(3000)
dbDoc.close(True)  ' -> closeVetoException

Your solution works, but it is a workaround. It is not described in Dev' Guide 6.4.5, sub-section "Closing a document". See in particular the flowchart "Closing a model".
I will file an issue.
   Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to