Loading ...
Sorry, an error occurred while loading the content.

490Re: Classic ASP and T-SQL

Expand Messages
  • Andy
    Aug 7 10:59 AM
      --- In json@yahoogroups.com, "neil_b" <neil@...> wrote:
      > First Post - I see most environments are covered with a library for
      > json except Classic ASP. I have one last major development to do with
      > it before moving on to something newer.
      > I imagine I could simply use Javascript mixed in with whatever other
      > scripting languages I use (VBScript and ActivePerl). Does anyone have
      > any guidance, comments or even code to help me with this approach?
      > I am also interested in creating json with T-SQL in SQL Server.
      > Comments on that are appreciated too.
      > Neil

      For converting ASP objects into JSON, I've had to write my own code to
      walk dictionaries, arrays, etc. I can't really share that.
      For converting JSON into something ASP can use, add

      function gParseJSON(aStr){
      return aStr.parseJSON();

      to the bottom of the stock JSON.js script file.
      Include in your site's code:

      <SCRIPT Language="JAVASCRIPT" RUNAT="SERVER" SRC="/json.js"></script>
      This will expose the scripts in there to your VB and JS server side

      const BR = "<br>"
      response.write "Testing parsing JSON into something:" & BR
      dim Point
      set Point = gParseJSON("{ ""x"" : 1, ""y"" : 2 }")
      response.write Point.x & BR
      response.write Point.Y & BR
      response.write Point.toJSONString() & BR
      response.write TypeName(Point) & BR
      response.write "Done Testing parsing JSON into something." & BR

      I have not yet learned how to find out what the names of all the
      properties are or how to access those dynamically. "For Each fld in
      Point" does not work.

    • Show all 2 messages in this topic