Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of Stack Space error

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
I have the following code set up in Access97 to automatically compact the database on exit. Occassionally, when executing, I get an "Out of Stack Space" error. I know this is usually due to a memory propblem but I have 256 MB of memory. It doesn't seem to matter what else I have running or how long I have been in the database.
Thanks, Bill

Public Sub CompactDB()
SendKeys ("C:\My Documents\Asset GB1.mde" & "{Enter}"), True 'The compact from db
SendKeys ("C:\My Documents\Asset GB1.mde" & "{Enter}" & "y"), True 'The compact to db.
'SendKeys "{Enter}", False
'SendKeys "Y", False
DoEvents
DoCmd.RunCommand acCmdCompactDatabase
Backup

End Sub
 
hi heathco,

don't know whether or not this will help but instead of going trough all this 'sendkeys' trouble you should try just:

DBEngine.CompactDatabase "original_db", "destination_db"

the kid
 
Thanks for your suggestion but DBEngine.CompactDatabase only works on a closed database. I need to compact the db before or during closure.
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top