How to use UPDATE?

127 views
Skip to first unread message

JVilar

unread,
Aug 29, 2012, 11:50:42 AM8/29/12
to asp...@googlegroups.com
the SELECT is perfect, but i'd like to use UPDATE int JSON.

What can i do? What can i change?

JSON_UTIL.asp
<%
Function QueryToJSON(dbc, sql)
        Dim rs, jsa
Set dbc = Server.CreateObject("adodb.connection")
dbc.open "provider=SQLOLEDB;server=.;Database=SurfByte","sa","surfbyte"

        Set jsa = jsArray()
        Set rs = dbc.Execute(sql)
       While Not (rs.EOF Or rs.BOF)
               Set jsa(Null) = jsObject()
                For Each col In rs.Fields
                       jsa(Null)(col.Name) = col.Value
               Next
        rs.MoveNext
        Wend
dbc.close
        Set QueryToJSON = jsa
End Function
%>

Diego Braga

unread,
Nov 21, 2014, 9:03:02 PM11/21/14
to asp...@googlegroups.com
Try this:

<%
Function QueryUpdate(dbc, sql)
Set dbc = Server.CreateObject("adodb.connection")
dbc.open "provider=SQLOLEDB;server=.;Database=SurfByte","sa","surfbyte"


        dbc.Execute(sql)
dbc.close

End Function
%>
Reply all
Reply to author
Forward
0 new messages