Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


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: users+unsubscribe@global.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.