请各位看一下这段代码有何错误!!
While j < 4
SHZ =Mid(ryxm, j, 1)
Sql="select * from DTYZ where HZ='" & SHZ & " ' "
rs2.open sql,adocon,3,2
if not rs2.eof then
SBY=rs2.Fields("BYCode")
else
SBY=""
end if
BY= BY + SBY
rs2.close
j=j+1
Wend
为何BY得到的值是最后的SBY而不是加起来的值!
如第一次:SBY为WANG,第二次:SBY为JI,哪么BY应该为:WANGJI,为何只得到JI.