Brad Bansner
asked on
ASP error when loading Scripting.Dictionary object
I'm occasionally getting errors that look like this:
Microsoft VBScript runtime
Object required: ''
The line where the error occurs looks something like this:
Earlier in the code, I setup the object like this:
The strange thing is, this works fine 99% of the time. But maybe 2-3 times a day, I get these errors reported (this is out of hundreds of daily users).
I am using the dictionary object pretty heavily, for language translations. The translations are stored in a database and then loaded into the dictionary object, then written to the browser. So I can easily change the text on the page to the correct language by loading the right translations into the dictionary object.
The ASP scripts where I am seeing these errors are loaded via AJAX, and several might be loaded into the main document simultaneously. But since they are distinct ASP scripts, I don't see why loading more than one at a time would cause any problem. The error sounds like the dictionary object doesn't exist, when it clearly does. Or that the object was closed.
I guess I am not really closing the dictionary objects at the end of the scripts. Could that be the problem?
Would appreciate any insight. Thank you!
Microsoft VBScript runtime
Object required: ''
The line where the error occurs looks something like this:
response.write(t.item("a"))
Earlier in the code, I setup the object like this:
set t=server.CreateObject("Scripting.Dictionary")
t.add a, "Text here"
The strange thing is, this works fine 99% of the time. But maybe 2-3 times a day, I get these errors reported (this is out of hundreds of daily users).
I am using the dictionary object pretty heavily, for language translations. The translations are stored in a database and then loaded into the dictionary object, then written to the browser. So I can easily change the text on the page to the correct language by loading the right translations into the dictionary object.
The ASP scripts where I am seeing these errors are loaded via AJAX, and several might be loaded into the main document simultaneously. But since they are distinct ASP scripts, I don't see why loading more than one at a time would cause any problem. The error sounds like the dictionary object doesn't exist, when it clearly does. Or that the object was closed.
I guess I am not really closing the dictionary objects at the end of the scripts. Could that be the problem?
Would appreciate any insight. Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER