SPATIUM Mobile
주소복사
About Operating System Languages Tools Favorites Notice Visit TEST  
     ADK (3)
     android (3)
     ASP (5)
     ASP.Net (1)
     C# (5)
     HTML (9)
     JAVA (7)
     JavaScript (9)
     jQuery (5)
     Mobile Web (2)
     node.js (1)
     Oracle (8)
     PHP (7)
     Spring Framework (4)
     SQL (17)
     WPF (5)
   ID  
   Password  
  |  
  Location United States
  IP Address 18.218.129.100
2024. 04
123456
78910111213
14151617181920
2122
23
24252627
282930
Category  Languages, ASP
Writer 김태우 Date 2012-06-28 18:22:06 Visit 9228
JSON 파일 생성

 

JSON 파일 생성

가끔 간단하게 데이터 송신할때, 그리고, jQuery에서 JSON 파싱이 쉽게 구현되어 있으므로, 사용하기 편하다.

 

 

<%@? codepage="65001">
<%
Response.CharSet = "utf-8"
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Expires","0"


 idx = request("idx")

 sQuery = ""
 sQuery = sQuery & " select * "
 sQuery = sQuery & " from table where rec_idx = '" & idx & "'; "
 
 Set RS = Server.CreateObject("ADODB.REcordSet")
 RS.Open sQuery, dbconn, 1, 1
 If Not(RS.EOF OR RS.BOF) Then
    'json
    response.write "{"
    response.write """product_serial_no"":""" &  RS("serial_no") & """"
    response.write ",""buy_year"":""" &  RS("buy_year") & """"
    response.write ",""buy_month"":""" &  RS("buy_month") & """"
    response.write ",""buy_day"":""" &  RS("bue_day") & """"
    response.write "}"
 End If
 RS.close
 Set RS = Nothing

%>

 

<%@  codepage="65001">

 

 

 

Tags  ASP JSON
  Relation Articles
[Languages-ASP] JSON 파일 생성 (2012-06-28 18:22:06)
  Your Opinion
Member ID
150 letters
Copyright (C) SPATIUM. All rights reserved.
[SPATIUM]WebMaster Mail