I’m trying to make JSON strings.
Each person would have several kids, and finally I can use root.toString object.
With below code, I got JSONException error.
In case I use below code instead, I don’t see any data for Kids.
'person.Value(“Kids”) = kids
Can you find anything wrong in below code?
Dim root as new JSONItem
Dim finalString As String
Dim colorArray() As String
Dim colorArrayCount As Integer = 0
colorArray = Array("#FF0F00","#0D8ECF")
While Not rs.EOF
Dim Person as new JSONItem
Person.Value("KKK") = rs.Field("KKK").StringValue
Person.Value("Ball") = Val(rs.Field("Ball").StringValue)
Person.Value("color") = colorArray(colorArrayCount)
While ( rs.Field("KKK").StringValue = rsEachQ.Field("KKK").StringValue )
Dim Kids as new JSONItem
Kids.Value("date") = rsEachQ.Field("GATHER_TIME").StringValue
Kids.Value("Ball") = rsEachQ.Field("Ball").StringValue
Person.append Kids
'person.Value("Kids") = kids
rsEachQ.MoveNext
Wend
root.append Person
rs.MoveNext
Wend
TextArea2.text = root.toString