views:

24

answers:

1

I'm trying to debug some old code in a VB6 application called from an ASP page. At a certain point in the page life cycle, I'm getting an "Object not set" error for either

ASPTypeLibrary.ScriptingContext.Application.Contents.Item or ASPTypeLibrary.ScriptingContext.Session.Contents.Item

I notice that some other code in the function uses Application.Value() to get values, and does not seem to be subject to the same problem. Is there a difference between .Value and .Contents.Item ? Different error handling, perhaps?

A: 

I assume you mean:

Application("variable")

vs.

Application.Contents(x)

? To my knowledge neither Application.Value() or Application.Contents.Item() is correct, but please correct me if I misunderstood something.

If my assumption is correct, Application("variable") simply gets or set a specific Application variable, whereas Application.Contents is a collection which contains all Application variables, and if your index into this is out of bounds you'll get an error.

Tchami