set db = CreateObject("ADODB.Connection")
db.Open("...")
sql = "select * from chacha where id=2"
set rs = db.Execute(sql)
row = 1
lie = ""
zhi = ""
shu = ""
do until rs.EOF
for x = 1 to rs.fields.count ' 或者直接写 to 8
waValue = rs("wa" &x)
if waValue != 0 then ' 如果数据类型是字符串,就把0改为"0"
lie = lie &row &","
zhi = zhi &waValue &","
shu = shu &x &","
next
rs.MoveNext
row = row + 1
loop
lie = left(len(lie)-1) ' 去掉最后一个逗号
lie = Split(lie, ",") ' 以逗号为分隔符,将字符串转为数组
zhi = left(len(zhi)-1)
zhi = Split(zhi, ",")
shu = left(len(shu)-1)
shu = Split(shu, ",")
大概就是这样,不知我对表的结构有没有理解错误。
拿到cursor对象后调用Cursor类的方法即可 如: String[] strs = new String[cursor.getCount()]String columnName=""int position = 0// cursor.moveToPosition(position)cursor.moveToFirst()while (cursor.moveToNext()) { int inde欢迎分享,转载请注明来源:内存溢出
评论列表(0条)