Connecting Tech Pros Worldwide Help | Site Map

Access will not close

  #1  
Old November 12th, 2005, 07:52 PM
Jeff
Guest
 
Posts: n/a
I have an access application that worked fine under access 97,
however, when it was converted to access 2002, access would no longer
close when the application was closed (using application.quit). The
application itself closes, but access remains open, and the only way
to close it is by control-alt-delete and ending the task. Does anyone
know why this is happening, and only under access 2002?
  #2  
Old November 12th, 2005, 07:52 PM
Albert D. Kallal
Guest
 
Posts: n/a

re: Access will not close


Hum, useally hte problem occurs in a97!

This often means that you have a open recordset somewhere in your code. This
is especially noticeable for GLOBAL reocrdset code.

So, for all reocrdsets that YOU open, make sure you both close the
reocrdset, and then set the recordset to nothing.

Example code to open a table, display all names to the debug window, and
then close:


dim rstRecs as dao.recordset
dim strSql as string

strSql = "select LastName from tblCustomers where City = 'Edmonton'"

set rstRecs = currentdb.OpenrecordSet(strSql)

do while rstRecs.EOF = false
debug.Print rstRecs!LastName
rstRecs.MoveNext
loop

rstRecs.Close
set rstRecs = nothing

So, check all of your recordset code, and make sure you always close the
recordset when done. That should fix the exit problem. You don't of course
have to close stuff like recordsetclone...but ONLY stuff YOUR code opens...


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
NoooSPAmkallal@msn.com
http://www.attcanada.net/~kallal.msn


  #3  
Old November 12th, 2005, 07:59 PM
Tony Toews
Guest
 
Posts: n/a

re: Access will not close


jmrkvicka@ruralins.com (Jeff) wrote:
[color=blue]
>I have an access application that worked fine under access 97,
>however, when it was converted to access 2002, access would no longer
>close when the application was closed (using application.quit). The
>application itself closes, but access remains open, and the only way
>to close it is by control-alt-delete and ending the task. Does anyone
>know why this is happening, and only under access 2002?[/color]

Also see Access minimizes to Windows 95/NT toolbar instead of closing
http://www.mvps.org/access/bugs/bugs0005.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
iexplorer will not close using vba Ronny Sigo answers 4 November 13th, 2005 05:21 AM
Combo box will not refresh? Lucinda Roebuck answers 2 November 13th, 2005 04:19 AM
CMD window will not close after Batch file executes Bill answers 4 November 12th, 2005 10:36 PM
CMD window will not close after Batch file executes Bill answers 4 November 12th, 2005 10:09 PM