阅读:1056回复:0
ActiveX connector help-cann't get fields of recordset object
<P><FONT color=#800080>一个关于fields对象的问题。recordset 应该有一个fields对象是可以获取某条记录中指定字段的值。但是我总是在这个相关语句上出错,换了很多种形式都不管用。后来发现fields记录集只有在采用了movefirst以后才能有效调用。可是当我用以下程序测试时,明明是用了movefirst,程序却总是执行else部分。</FONT></P>
<P><FONT color=#800080>还请大虾释疑解惑</FONT></P> <P><FONT color=#800080>Dim mSelRecord<BR>set mSelRecord=mlayer.recordset</FONT></P> <P><FONT color=#800080>dim mFields</FONT></P> <P><FONT color=#800080>mSelRecord.movefirst<BR>if mSelRecord.movefirst then<BR> for i=1 to mCount<BR> <BR> response.Write mSelRecord.CurrentIndex <BR> response.Write(";nbsp; ;nbsp;")<BR> <BR> mFields=mSelRecord.fields<BR> fieldValue=mfields(1)<BR> response.Write(fieldValue)<BR> response.Write("<br>")<BR> mSelRecord.movenext<BR> next<BR>else<BR> response.Write("no movefirst")<BR> response.Write(mSelRecord.movefirst)<BR>end if</FONT></P> |
|