紧急请编程高手,很急

来源:百度知道 编辑:UC知道 时间:2024/05/14 22:49:37
四、 根据下面的查询页面文件,填充完成响应页面(20分):
下列的响应页面功能是将表单提交的姓名和课程信息查询数据库grade.mdb的数据表student(共有name,subject和score三个字段,前两字段数据类型均为文本,最后字段数据类型为数字)是否有该记录,若有则在浏览器上显示成绩,如果表内不存在对应成绩,显示“对不起,未找到您需要的信息!”。表单的文本框名称为“subject“和“name”(对应subject和name字段值)。数据源与数据库同名。

<%
a1=
a2=
set Conn=Server.CreateObject(ADODB.connection")
Conn.open("testdata")
set RS1=Server.CreateObject("ADODB.RecordSet")
SQL=" * from where
Set RS1=Conn.Execute(SQL)

If then
Response.write "<html><head><title></title></head>"
Response.write "<body bgcolor=#fff5ee>"
Response.write "<center>对不起,未能找到您需要的信息!</center>"
Response.write "</body></html>"
else

a1=request.form("subject")
a2=request.form("name")

SQL="select * from student where name='"&a2&"' and subject='"&a1&"'"

If RS1.eof then

Response.write "<center>您的成绩:"&RS1("score")