现在的位置: 首页 > 综合 > 正文

domina 写规则 返回JSON 数据

2013年12月01日 ⁄ 综合 ⁄ 共 985字 ⁄ 字号 评论关闭

Sub Initialize
 On Error Goto errormsg
   dim sql as string
   dim fldLst as new lcfieldList
   dim lcCaTypeName as lcfield
   dim josndata as string
   dim isNext as  Boolean
  
   dim strTemp as string
   dim index as integer
   sql="select * from S010_MoldCata"
   josndata =""
   strTemp = ""
          isNext = false

   call WF_Con.execute(sql,fldLst) '对数据到数据集fldLst中去
            set    lcCaTypeName  = fldLst.lookup("MoldCataName")
          
            while WF_Con.fetch(fldLst)>0
                     strTemp =|{"text":"|+lcCaTypeName.text(0) +|"}| 
                     if isNext = true     then      
                      josnData = josnData +","+strTemp 
                     else
                         josnData = josnData +strTemp  
                  
                 isNext = true
                     end if           
               wend
 
                josnData  =   |[| +josnData + |]|         
                Msgbox josnData
          print "Content-Type:application/text;charset=utf-8"
         
  print josnData
  
  Exit Sub
errormsg:
 Msgbox "Rule Error:" & Str(Erl) & "  " & Error
End Sub

抱歉!评论已关闭.