Convert Variant to Json

89 views
Skip to first unread message

@lusabo

unread,
Aug 1, 2011, 4:24:13 PM8/1/11
to JSON for ASP
Hi All,

I'd like to know how can I convert my Variant to a Json Object with JS
Object.

See my situation:

I have a Variant like this:

a(0,0) = "Code"
a(0,1) = "103"
a(0,2) = "101"
a(1,0) = "Name"
a(1,1) = "Bob"
a(1,2) = "Mary"

When a call the toJSON(a) I have the return:

[["Code","103","101"],["Name","Bob","Mary"]]

Code and Name are the names of the columns.

I'd like to have the return like this:

[
{
"code":"103",
"name":"Bob"
},
{
"code":"101",
"name":"Mary"
}
]

Are there some way to do this?


Thanks, Luciano

@lusabo

unread,
Aug 1, 2011, 4:25:26 PM8/1/11
to JSON for ASP
Reply all
Reply to author
Forward
0 new messages