Results 1 to 9 of 9

Thread: For Each + JSON2 = Object doesn't support this property or method

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2025
    Posts
    3

    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

  2. #2
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,833

    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>

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2025
    Posts
    3

    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.

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,833

    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>

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2025
    Posts
    3

    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.

  6. #6
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,833

    Re: For Each + JSON2 = Object doesn't support this property or method

    Quote Originally Posted by kinguru View Post
    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>

  7. #7
    New Member
    Join Date
    Apr 2025
    Posts
    2

    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?

  8. #8
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,833

    Re: For Each + JSON2 = Object doesn't support this property or method

    Quote Originally Posted by BobT-VB View Post
    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>

  9. #9
    New Member
    Join Date
    Apr 2025
    Posts
    2

    Re: For Each + JSON2 = Object doesn't support this property or method

    Quote Originally Posted by wqweto View Post
    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
  •  



Click Here to Expand Forum to Full Width