troubleshooting Question

Pass SQL to JSON. Page is in classic ASP and using Jquery

Avatar of Aleks
AleksFlag for United States of America asked on
ASPSQLjQueryJSONWeb Development
4 Comments1 Solution642 ViewsLast Modified:
I have a page (ASP classic) which has a recordset with data.

recordset name:  rs_contact
field1:  FName
field2: LName
field3: email

This is the first time I will be doing this so a good explanation would be very much appreciated.
I need to pass this data to a JSON format so that I can the post it to an URL (to be used by an API)

The page is in classic ASP. The data I need to pass is in the format below. This considering I only got one result in my recordset and the values returned are:

FirstNm = 'Aleks'
LastNm = 'Demo'
email = 'support@domain.com'

Those values somehow need to be turned into this JSON
We have to consider there may be more than one result from the recordset, another set of values would be:

Alma
Doe
alma@domain.com

etc.

This is the JSON file example I have to create:

{
  "first_name": "Aleks",
  "last_name": "Demo",
  "email_addresses": [
    {
      "email_address": "support@domain.com"
    }
  ]
}

Once this is created I need to post the data to an URL that is also stored in a recordset.

The URL will require a token as parameter, so I need to pass 2 parameters, the first part is the URL and the second is the token.

something like: https://<%=url("value")%>?token?<%=token("value")%>

Example:

http://myurl/contacts/add?token=ada23-4234-234234-2

We can break this down in those two parts. One is taking the recordset info and converting it into JSON.  And the second part is posting this JSON to the URL.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros