Access process hanging - Need help

  • Thread starter Thread starter Jens Egil Evensen
  • Start date Start date
J

Jens Egil Evensen

Hi

I have developet a rather complex application for the
Norwegian government, using Access 2000 format database
aand application-file. When I open the database on a
Windows XP with Office XP SP2 (probably others too), the
Access application remains in the process-list even though
the window is closed. I had this problem earlier in the
developing stage, but then I discovered that if I replaced
calculated fields using the DSum function, the problem was
fixed. But.... Now the problem is back.. I know that you
can get this problem if you uses objects from other
libraries, and don't close them properly, but I'm sure
that is not the case here.
The symptoms are as follows:
-When Access is closed, the temporary files (.ldb) remains
in the application folder.
-MSAccess is still in the processlist in task anager.
-If i try to open access nothing happens.
-If I try to open access application that have a dialogbox
of some kind in the startupprocedures,...it appears on the
screen!!! But the access application and menus doesn't
appear.
-If I kill the access process in the taskmanager and then
opens the application, everything works fine.

It looks like the Applications starts but nothing shows up
on the screen...

Could this e a bug in Microsoft Access? I do not have the
problem using the same application on a computer with
office 2003 installed.

I also use DLookup in several fields in the forms.. could
that be the reason? Some bug in the Built-in functions?

I hope you guys can help...

Best regards
Jens Egil Evensen
 
Have you tried re-compiling the code on the offending pc, and see if any
errors occur?

Often doing the above will help you pin point the problem.
 
I tried that now, and it did not return any errors or
solve the problem.
It looks to me (I can't tell 100%) that the problem is
related to some of the built-in functions in Access (Dsum,
Dlookup etc.).
Another strange circumstance is that it is only a problem
on Windows XP and some configurations of Windows 2000....


Best regards
Jens
 
I have read on some sites that DLookup does not always close its
recordsets correctly. I would try writing a 'clean' version of the
function (say, DLookup2 or DSum2) and doing a ReplaceAll to see if it
helps anything.

A replacement DLookup might look like this (using DAO):


Public Function DLookup2(field as string, domain as string, whereclause
as string optional)
Dim rst as DAO.Recordset, fld as DAO.Field, strSQL as string, DL2 as
Variant
strSQL = "SELECT TOP 1 " & field & " FROM " & domain
If len(whereclause)>0 Then strSQL = strSQL & " WHERE " & whereclause
Set rst = CurrentDB.Openrecordset(strSQL)
If not rst.eof and not rst.bof Then
For each fld in rst.Fields
DL2 = rst.Value
Next fld
Else
DL2 = Null
End If
rst.Close
DLookup2 = DL2
End Sub

I think that ought to work though I just wrote it off the cuff and
haven't tested it yet. Somewhat of a longshot but who knows, might help
and would be easy enough to undo if it didn't prove to have the answer.
 
Back
Top