用filter属性,我们我们可以对记录集进行动态的过滤。以获得我们想要的数据。举一个例子:
加入记录集对象为rs,其中的数据为:
user_id comefrom age wifecount childcount
northsnow 中国 28 100 3000
bill gates 美国 45 90 6
liujincai 中国 28 80 1000
csdn 中国 7 7 3
ford 美国 80 1 80
benz 德国 70 9 100000
henry 法国 19 1 4
shit 日本 90 9000 0
pig 日本 9 1 8
我们可能在多个地方,甚至循环中调用不同国籍的用户。那么我们可以用到filter属性了。
比如:
'??????????????
rs.filter="comefrom='中国'"'
if not(rs.eof and rs.bof) rs.movefirst
'??????????????????
rs.filter="comefrom='日本"'
if not(rs.eof and rs.bof) rs.movefirst
'????????????????
' ………………
'………………
'????????????????????
浙公网安备 33010602011771号