asp+access读取数据库问题
学生提交作业数据表如下:xuehaotypewenjian1fla1.fla1swf1.swf7fla7.fla3fla3.fla3swf3.swf9swf9.swf但有...
学生提交作业数据表如下:
xuehao type wenjian
1 fla 1.fla
1 swf 1.swf
7 fla 7.fla
3 fla 3.fla
3 swf 3.swf
9 swf 9.swf
但有时学生交作业只交了swf没交fla,或者只交fla没交swf,
我想判断哪个学生的那个文件没交,
这样读取不对,应该怎么改?
Dim objRS,strSQL
Dim objRS2,strSQL2
strSQL="SELECT * FROM zp where(type= 'swf') order by id asc"
Set objRS=GetSQLRecordset(strSQL,"DB.mdb","zp")
strSQL2="SELECT * FROM zp where(type= 'fla') order by id asc"
Set objRS2=GetSQLRecordset(strSQL2,"DB.mdb","zp")
Do While Not objRS.EOF
Do While Not objRS2.EOF
if objRS2("xuehao")=objRS("xuehao") then
Response.Write objRS("wenjian")
Response.Write objRS2("wenjian")
else
Response.Write objRS("wenjian")
Response.Write "fla没交"
end if
objRS.MoveNext
objRS2.MoveNext
Loop
Loop
objRS.Close
Set objRS=Nothing
objRS2.Close
Set objRS2=Nothing
objConn.Close
Set objConn=Nothing 展开
xuehao type wenjian
1 fla 1.fla
1 swf 1.swf
7 fla 7.fla
3 fla 3.fla
3 swf 3.swf
9 swf 9.swf
但有时学生交作业只交了swf没交fla,或者只交fla没交swf,
我想判断哪个学生的那个文件没交,
这样读取不对,应该怎么改?
Dim objRS,strSQL
Dim objRS2,strSQL2
strSQL="SELECT * FROM zp where(type= 'swf') order by id asc"
Set objRS=GetSQLRecordset(strSQL,"DB.mdb","zp")
strSQL2="SELECT * FROM zp where(type= 'fla') order by id asc"
Set objRS2=GetSQLRecordset(strSQL2,"DB.mdb","zp")
Do While Not objRS.EOF
Do While Not objRS2.EOF
if objRS2("xuehao")=objRS("xuehao") then
Response.Write objRS("wenjian")
Response.Write objRS2("wenjian")
else
Response.Write objRS("wenjian")
Response.Write "fla没交"
end if
objRS.MoveNext
objRS2.MoveNext
Loop
Loop
objRS.Close
Set objRS=Nothing
objRS2.Close
Set objRS2=Nothing
objConn.Close
Set objConn=Nothing 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询