Would closing the connection have sufficed?
If not, what is the difference between closing a connection and
disposing of a connection?
andrew wrote:
Marc Santhoff wrote:
BUT - ah ha I found the bug..it was my code - well, maybe not.all my
code.
I did not dispose of the connection within the script.
When I add the dispose with
Sub defrag_database( sRegName as string )
dim ctx, db, con, stmt
ctx = createUnoService("com.sun.star.sdb.DatabaseContext")
db = ctx.getByName(sRegName)
con = db.getConnection( "", "" )
stmt = con.CreateStatement
stmt.ExecuteUpdate( "CHECKPOINT DEFRAG" )
con.dispose
End Sub
Now the file immediately shrank to 9,557KB - without having to exit OOo
I noticed that after the first run the .lck file was not removed until
after OOo was fully closed, and that is what tipped me off.
What is insulting is that I really know enough from esxperience to
alwasy explicilty dispose of those [EMAIL PROTECTED] connection variables..
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]