TDocVariantData解析JSON
var
json: RawUTF8;
doc: TDocVariantData;
i: integer;
begin
DataBase := TOleDBMSSQLConnectionProperties.Create('127.0.0.1,8829', 'yndb', 'sa', 'sa');
// DBServer := TSQLDBServerHttpApi.Create(DataBase, 'jj', '6789', 'admin', 'admin', False, 8, nil, tmThreadPool);
qry:=TQuery.Create(DataBase.ThreadSafeConnection);
qry.Close;
qry.SQL.Clear;
qry.SQL.Add('select top 100 * from t2');
qry.Open;
json := qry.PreparedSQLDBStatement.FetchAllAsJSON(True);
qry.Free;
// DataSource1.DataSet := JSONToClientDataSet(Self, json);
doc.InitJSONInPlace(Pointer(json), JSON_OPTIONS_FAST_STRICTJSON);
json := '';
for i := 0 to doc.Count-1 do begin
Memo1.Lines.Add(doc.Values[i].c1);
end;