是什么原因使Rs2.MoveNext不移动到下一条记录而是移动到别的一条记录
程序如下:Set Rs2 = Server.CreateObject("ADODB.Recordset")
sq2 = "SELECT * FROM "&md&""
‘"&md&"为学生名单表
Rs2.open sq2,conn,1,1
‘以下是建学生考试成绩数据表session("cj")
SQL = "CREATE TABLE ["+session("cj")+"] ("
SQL = SQL & "[id] identity not null ,"
SQL = SQL & "[xh] char (8) NOT NULL,"
SQL = SQL & "[xm] char (8) NOT NULL,"
for i=0 to ubound(ValueArray)-1
SQL = SQL & "["&ValueArray(i)&"] number ,"
next
SQL = SQL & "[zf] number ,"
SQL = SQL & "[bjmc] number ,"
SQL = SQL & "[njmc] number "
SQL =SQL& ")"
Set RS = Conn.Execute(SQL)
kskms=ubound(ValueArray)+3
‘以下是初始化学生考试成绩数据表session("cj"),设所有考试成绩为-1
j=1
While (NOT Rs2.EOF)
ls="'"+cstr(j)+"',"+"'"+Rs2.Fields.Item("xh").value+"'," +"'"+Rs2.Fields.Item("xm").value+"',"
for i=1 to kskms
ls=ls+cstr(-1)+","
next
ls=left(ls,len(ls)-1)
strq="insert into "&session("cj")&" values("&ls&")"
conn.execute strq
‘问题就出在下面一句,本应该依次把学生名单表中的“学号(XH)和姓名(XM)”插入学生考试成绩数据表session("cj"),但是就是不知道什么原因,本程序没有依学生名单的次序,而是把学生名单的次序打乱了插入学生考试成绩数据表session("cj"),我请教的就是:此语句明明是移动到下一条记录,是什么原因会不跳到下一条记录而是移动到另外一条记录去?
Rs2.MoveNext
j=j+1
wend