How to close *.dbf files in a Base (makro)

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!

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.