<%
Function QueryToJSON(dbc, sql)
	Dim rs, jsa
    Set rs = dbc.Execute(sql)
    Set jsa = jsArray()
    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
	Set QueryToJSON = jsa
End Function

Function RecordsetToJSON(ByVal rs)
	Dim jsa,col
    Set jsa = jsArray()
    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
	Set RecordsetToJSON = jsa
End Function

%>