如何从多个数据表中存取数据???
我要从三个表中存取数据.
其中有:
student表:
id,psw,sname,mark,hd
class表:
student,course,tid
course表:
courseid,cname,credit,ct
关系是这样的:
student.id=class.student
course.courseid=class.course
现在我想查询三个表中的所以东西..
<% '查询
id=session("id")
sql ="select * from student,class,course where class.student='"&id&"' and student.id = class.student and course.courseid = class.course"
set rs=conn.execute(sql)
sname=rs("sname")
mark=rs("mark")
hd=rs("hd")
cid=rs("course")
cname=rs("cname")
credit=rs("credit")
ct=rs("ct")
%>
这样写,出错:
错误类型:
ADODB.Field (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/page/student.asp, 第 23 行
请问,应该怎样改呢?? 麻烦了....