I have inherited a database that uses a number of custom classes and unfortunately very little error trapping. Recently I have been encountering an intermittent object variable not set message for some users. Users are working over a broadband connection onto the server, which may be of relevance, although there is no evidence of connectiviy blips.
A number of pieces of script call functions that call the constructor for a custom class. The constructor (e.g. dim comLine as New CommitmentLine) then calls a constructor for a Global class. By means of some error trapping and defensive coding that was added, I have identified users are receiving object variable not set messages in the instantiation of one of the two objects for the custom classes. These constructors capture the current document and details of the current user’s environment, so there is nothing that should generate an object variable not set message. One point of note is that there are no destructors for the custom classes.
There are a number of best practice improvements I will be making - the Global class has not been used since before I inherited the database, so I will be taking that out; I will be adding destructors to all classes, in case memory is the issue; I will be ensuring the functions abort if an error occurs.
I also know about the issues with object variable not set messages when opening a document from a link in mail. That is not relevant to this scenario.
These improvements will at worst mitigate the problem, at best possibly solve it. My hypothesis is that memory is the issue, but I have been unable to find any evidence to support it. My question is has anyone else has had issues with strange object variable not set messages when using custom classes if objects are not destroyed after use?
Thanks
Paul