,EG:HTML5 SQLLite
如何执行以下操作:
For i = 0 To RS.Fields.Count -1
Response.Write "Field Name: " & RS.Fields(i).Name & "<br>"
Response.Write "Field Value: " & RS(i) & "<br>"
Next
如果......,
或者,另一个问题是,如何迭代列本身并以最佳方式检索列名称。
答案 0 :(得分:0)
我找到了答案
function showQueryResults(tx, r) {
// alert("showing [" + r.rows.length.toString() + "] query results");
var rs = null;
var $tr, $td;
var $t = $("<table border='1' cellpadding='2 cellspacing='0' />");
if (r.rows.length > 0) {
rs = r.rows.item(0);
$tr = $("<tr />");
$.each(rs, function (key, val) {
$tr.append($("<th>" + key + "</th>"));
});
$t.append($tr);
for (var i = 0; i < r.rows.length; i++) {
rs = r.rows.item(i);
$tr = $("<tr />");
$.each(rs, function (key, val) {
$tr.append($("<td>" + rs[key] + "</td>"));
});
$t.append($tr);
$tr = null;
};
};
$("#formHolder").children().remove();
$("#formHolder").append($t).show();
$t = null;
};