sub command1_click dim rs as new adodb.recordset dim s as string dim n as long rs.fields.append "FldA",202,50 rs.openrs.addnew rs(0)="数组1" rs.addnew rs(0)="数组2" rs.addnew rs(0)="数组3" ...........rs.sort="FldA" rs.movefirst while not re.eof if s<>rs(0) then print s,,"出现" & cstr(n) &"次" n=1 s=rs(0) else n=n+1 end if .movenext wend print s,,"出现" & cstr(n) &"次"end sub
放入数据库,然后select count(*), first(arraycontent) from table group by arraycontent
然后CONT(*)
dim rs as new adodb.recordset
dim s as string
dim n as long
rs.fields.append "FldA",202,50
rs.openrs.addnew
rs(0)="数组1"
rs.addnew
rs(0)="数组2"
rs.addnew
rs(0)="数组3"
...........rs.sort="FldA"
rs.movefirst
while not re.eof
if s<>rs(0) then
print s,,"出现" & cstr(n) &"次"
n=1
s=rs(0)
else
n=n+1
end if
.movenext
wend
print s,,"出现" & cstr(n) &"次"end sub