- I’ve squandered most of the day on a legacy Agent called via AJAX that inexplicably started throwing “Object Variable Not Set” on the server console. This is annoying for several reasons:
-
There is an error handler in effect at the line that errors, yet that error handler is never triggered. Instead the error message continues to appear on the server console.
-
I’ve done a chemo-shotgun “Rebuild All LotusScript”, without error, and without effect.
-
I put in “Print”, which borks the AJAX horribly, but at least I can see that in Firebug. I have this code:
Print |Initialize|
Set ns=New NotesSession
Set db=ns.currentDatabase
Set lit=New Literal
Print |- Log|
Print | Looking for |+lit.LOGDBPATH
If(ns Is Nothing) Then Print | No session | : Exit Sub Else Print | Platform |+ns.Platform
Print | On |+ns.Getdatabase(ns.currentDatabase.server, “\EE\EECatsLog.nsf”).title
Set aldb=ns.getDatabase(“”, lit.LOGDBPATH)
Print | Current Check|
where ns, db, and lit are Agent global as NotesSession, NotesDatabase, and Literal Class respectively. That code produces this output:
Initialize
-
Log
Looking for EE\EECatsLog.nsf
Platform Windows/32
On
-
What? No error on getDatabase, but no Title?? The next line, where it sets aldb without a server path, is the one that’s been “causing” the problem all along. The aldb variable is also global as NotesDatabase.
- Did I mention this has worked for months? I did NOTHING to it, yet it’s irrevocably broken, apparently. I have much, much more important things that I should be doing, not fixing code that shouldn’t be broken.
How do I fix this? Thanks for your time…