login about faq

I am trying to create a JSON string from a database using the Chilkat JSON object. I started with the example here: Create more Complex JSON Document. The JSON that I am trying create is a dictionary of arrays. If I modify the example code by removing the top 3 strings I get an object error. I am not sure the cause but I think it is something internal.

set json = Server.CreateObject("Chilkat_9_5_0.JsonObject")
Response.Write json.Version   <--

' success = json.AddStringAt(-1,"Title","The Cuckoo's Calling")
' success = json.AddStringAt(-1,"Author","Robert Galbraith")
' success = json.AddStringAt(-1,"Genre","classic crime novel")   <-- allow any of these line and there is no error

success = json.AddObjectAt(-1,"Detail")
Set detail = json.ObjectAt(json.Size - 1)
success = detail.AddStringAt(-1,"Publisher","Little Brown")   <-- runtime error '800a01a8' Object required

asked Mar 30 '16 at 17:59

emartinson's gravatar image


Thanks! This was a bug -- if the JSON object is completely empty, and the very first item added is a sub-object, then the AddObjectAt returns false to indicate failure. (Internally, there is some initialization code that needed to be called but was not.)

This new build should fix it:

32-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-win32.zip

64-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-x64.zip


answered Apr 02 '16 at 15:29

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Mar 30 '16 at 17:59

Seen: 2,131 times

Last updated: Apr 02 '16 at 15:29

powered by OSQA