-
Mar 14th, 2025, 03:16 AM
#1
Thread Starter
New Member
For Each + JSON2 = Object doesn't support this property or method
Dear community,
I'm looking for solution or help with the problem.
The problem is that "For Each" fail with error "0x800a01b6 Object doesn't support this property or method".
JSON - is json2 javascript lib.
The mystery is that it was working fine always (no code changes) and still working on Windows 2019 server IIS. But stops working on dev machines win11.
Code:
Set data = JSON.parse(requestBody)
For Each o IN query.Products
Best regards
ASP dev
-
Mar 14th, 2025, 04:13 AM
#2
Re: For Each + JSON2 = Object doesn't support this property or method
You are setting data variable but looping query's products which makes no sense.
Btw, Option Explicit oftentimes prevents such mistakes.
cheers,
</wqw>
-
Mar 28th, 2025, 01:40 AM
#3
Thread Starter
New Member
Re: For Each + JSON2 = Object doesn't support this property or method
Products is array. There is no mistake in names. All js arrays in app just stops working in cycle.
-
Mar 28th, 2025, 04:38 AM
#4
Re: For Each + JSON2 = Object doesn't support this property or method
> There is no mistake in names.
Where do you set query in code above? Why do you show setting data but not query?
cheers,
</wqw>
-
Mar 28th, 2025, 07:39 AM
#5
Thread Starter
New Member
Re: For Each + JSON2 = Object doesn't support this property or method
Query is json2.js parse result.
I've to replace json2 with another parse lib to make it working back. The reason is recent windows update. W11 and server 2025 affected.
Also I've strange sporadic engine errors exceptions after system update. So I would suggest to stay on server2019 but I think it will be affected also soon.
-
Mar 28th, 2025, 08:12 AM
#6
Re: For Each + JSON2 = Object doesn't support this property or method
 Originally Posted by kinguru
Query is json2.js parse result.
I've to replace json2 with another parse lib to make it working back. The reason is recent windows update. W11 and server 2025 affected.
Also I've strange sporadic engine errors exceptions after system update. So I would suggest to stay on server2019 but I think it will be affected also soon.
On this line
Set data = JSON.parse(requestBody)
. . . is data json2.js parse result too?
So you have both data and query as parse results from requestBody?
cheers,
</wqw>
-
Apr 7th, 2025, 10:18 AM
#7
New Member
Re: For Each + JSON2 = Object doesn't support this property or method
Hi,
I'm having the same issue. What replacement parsing library did you choose?
-
Apr 7th, 2025, 10:56 AM
#8
Re: For Each + JSON2 = Object doesn't support this property or method
 Originally Posted by BobT-VB
Hi,
I'm having the same issue. What replacement parsing library did you choose?
You are having the same basic programming error?
Just don't use query variable in your code when you have set data variable with results of the parser and probably put an Option Explicit on top of your code for good measure.
cheers,
</wqw>
-
Apr 7th, 2025, 11:06 AM
#9
New Member
Re: For Each + JSON2 = Object doesn't support this property or method
 Originally Posted by wqweto
You are having the same basic programming error?
Just don't use query variable in your code when you have set data variable with results of the parser and probably put an Option Explicit on top of your code for good measure.
cheers,
</wqw>
Sorry, I should have been clearer.
After server updates I now receive an error (Object doesn't support this property or method) when trying to access a json array returned by the json2 Parse method.
The original poster mentioned a replacement library.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|