"Michiel Rapati-Kekkonen" <nn@nonsense.zz wrote in message
news:Fq******** *******@read4.i net.fi...
my understanding is that you can copy a backend on condition that all
recordsets are closed.
But it is not what I experience.
Is there a way to find out what keeps the backend connected? (maybe I
forgot a recordset somewhere)
thanks for any input
Keep in mind that you can't call any code from a *bound* form that is
opened, that'll close all the connections.
Let me explain
form1: bound ---call forms2
form2: unbound, runs code to close form 1
You connection will stay open. Why?
it is the stack nature of objects and how ms-access cleans up it memory.
In memoory, while form1 is closed, not all of the memory is released until
the code *returns
eg:
memory form1 (and connection)
calls ----form2 (no connection
----form2 closes form1
*only* when form2 closes does the calling code + memory from form1 actually
finally get released....
So, what this means is if you manually close form1 and THEN open form2, and
then have a button on form2 that does the compact and repair, then you
should be ok. I not tried this but it possible that if form 1 called form2
via a macro (and not code), then the connection *likely* would also be
closed. It just a question when ms-access cleans up it memory...
So, if you "main" form, or startup form is un-bound, then you should be
able to place a button on that main form that does the compact and repair.
And even better way is to put a option in a custom menu bar, and have that
call code in a module. (this module code can close all forms, and since
there is no program stack called *from* that forms...there is not return
stack..and thus the connections are released).
at
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com