Access keeps running in the process list even if closed.

M

Michel S.

Hi !

I posted a few days ago about Access (2002) process not closing in the
task list even after the application is closed.

I searched thru my entire code for unclosed
objects/recordsets/connexions/querydefs etc.. and these not set to
nothing, but at no avail.

I also looked for controls tested like " IF chkBox01 Then" instead of
specifying "If chkBox01 = True Then", but this not applies either.
(And I think this bug was in Access 97 only).


Are there some other catches like this ? For instance, if I test a
recordset EOF property, do I have to specify "If rst.EOF = True Then"
or does the for "If rst.EOF Then.." is okay ?

Also, I use many unbound (at design time) subforms for which I set the
"SourceObject" and "RecordSource" dynamically at runtime. Do I have
to reset these properties to nothing ? Do I have to specifically
close the subforms ?

Does the same applies if the "RecordSource" is a dynamically built
string containing an SQL statement ?


Another source of confusion is the use of ! instead of . to prefix
recordsets fields names. I read somewhere that this can cause Access
to not close properly. But I can't no longer find the reference.

Finally, I use some object arrays (containing class instances). Upon
exciting, I loop thru the array to set each instance to nothing, and
then I erase the array. But I also noted that if I only erase the
array without setting each element to "Nothing", the "terminate" event
of the class instance is fired too. Am I overdoing things by doing
this (set to nothing then erase) or this is a good practice ?

Any other ideas are welcome to nais down this problem.

Thanks !
 
G

Guest

You may want adapt a little trick that I use to catch processes as they end.
In my code I give each process a code noted as 'Erm = "*code*"
I place to commented strings in the code, one at the start - 'sssss - one at
the end prior to the exit - 'eeeee

Using Find and Replace I can very quickly replace those commented strings
with something like
MsgBox "Start " & Erm
Or
MsgBox "Finish " & Erm

This way I can track what is going on for tracking and trapping purposes.
Then when done and before you send the application out, replace those MsgBox
with commented strings.

Its a bit of work to set it up, but it pays dividends in time saved in the
long run.

Regards,
Nick

Private Sub List2_DblClick(Cancel As Integer)
On Error GoTo Errtrp
Dim Erm As String
Erm = "F399/L2Dcl"
'sssss
DoCmd.OpenForm "Rental", acNormal, , , acFormAdd, acDialog
'eeeee
Exittrp:
Exit Sub

Errtrp:
Call Errortbl(Err.Number, Err.Description, Erm, Me.Name, True)
Resume Exittrp

End Sub
 
M

Michel S.

I finally found it. It's *only* a pair of parentheses.

One of my objects has a method (Sub) receiving a textbox as a
parameter.

In the calling form, I didn't use the Call statement, but the textbox
reference was in parentheses.

As a result, the textbox was passed By Value, and since that copy was
never set explicitly to "Nothing".... Well, you guess what the rest
is.

Still banging my head on my desk...

Hope this helps others who may experience the same situation.


Thanks to all who replied.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top