SPATIUM Mobile
주소복사
About Operating System Languages Tools Favorites Notice Visit TEST  
     Android (3)
     Linux (1)
     MacOS (1)
     OS (1)
     Solaris10 (15)
     Windows (1)
     Windows Server (2)
     Windows XP (3)
   ID  
   Password  
  |  
  Location United States
  IP Address 3.139.80.15
2024. 05
1234
567891011
12131415161718
19
202122232425
262728293031
Category  Languages, ASP
Writer 김태우 Date 2012-06-28 18:22:06 Visit 9252
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