Am 03.01.2016 um 12:17 schrieb Walther Koehler:
> Hello list, high Andrew Pitonyak,
>
> After an SQL UPDATE in a makro, the updated *.dbf is still marked as open
> (in LINUX see fuser *.dbf), until the last instance of LO is closed. This is
> nasty, because I have usually many files open and want ot access the *.dbf by
> other progs. How do I close that file?
>
> [Even
> oDoc=dataSource.DataSourceDocument
> oDoc.close
> doesnt help (the *.odb wasnt open anyway)]
>
> Walther
>
> Andrew, thank you for your makro guide!
>
Close the _connection_ to the database.
Basic snippet generated by MRI:
> Sub Snippet(Optional oInitialTarget As Object)
> Dim oObj1 As Variant
> Dim oConnection As Variant
> Dim oTables As Variant
> Dim oObj2 As Variant
>
> oObj1 = oInitialTarget.getByName("Bibliography")
> oConnection = oObj1.getConnection("", "")
> oTables = oConnection.getTables()
>
> oObj2 = oTables.getByName("biblio")
> oConnection.close()
> End Sub
When I access oObj2, fuser reports the office process owning biblio.dbf.
After closing the connection, fuser reports no process.
However, I am not sure about the side effects of connection pooling or
any other office connections to the same database (spreadsheet links,
serial letters, opened forms). IMHO, it could be that other connections
still access your database after closing the connection that had been
established by your macro.
--
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