tempvars

John Sh

Member
Local time
Today, 22:21
Joined
Feb 8, 2021
Messages
493
I recently has a situation where I had to prematurely close an accde file. This closure left a number of tempvars on the system.
My opening sub checks for the existence of one such tempvar to either run the startup routine or go straight to the main menu.
The result was that the main menu was opened incorrectly, and inoperative, and the program was again shutdown prematurely. Long live the tempvars.
Ultimately temporarilyI used tempvars.removeall at the beginning of the startup sub and the softwre ran as expected.

Question.
Is there a way to eliminate tempvars other than via access vba?

I have been using tempvars for some time, now with great success. As this is the first negative encounter I have had, I will continue to use them because, IMO, their benefits far outweigh any downsides.
 
My opening sub checks for the existence of one such tempvar to either run the startup routine or go straight to the main menu.
The result was that the main menu was opened incorrectly, and inoperative, and the program was again shutdown prematurely. Long live the tempvars
I pretty sure what you think happened, is not really what happened although the symptoms may have appeared to suggest that. TempVars go out of memory when the datbase closes. Period, not sometimes, but all the time. So my only guess is that the database never actually closed. There are some old bugs that suggest this is possible. But your solution to clear potential tempvars before reassigning would make sense.
 
This closure left a number of tempvars on the system.
tempvars like any other variables are destroyed when you terminate the db.
 
I'm late in responding, but I agree with my colleagues. A TempVar is a memory-resident entity, occupying the process-private local memory of the DB (for single-file databases) OR the process-private local memory of the Front-End DB (for split databases). The only way a TempVar can survive is for the process to not properly terminate. Once a process actually terminates, it gives up all memory for reclamation.

You can get a feel for what actually happens in memory by searching for Windows Memory Paging Dynamics. Below are two articles to understand memory use.


 

Users who are viewing this thread

Back
Top Bottom