|
大家好,这是一个含asp代码的页面代码.在运行时出现如下错误
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft VBScript 编译器错误 错误 '800a0401'
语句未结束
/claw/99tm/cc454/Selectrecord.asp,行374
sql="where age>=" & age1 &" and "age<="& age2
---------------------------------^一下是代码:
!--#include file="conn.asp"-->
<html>
<head>
<title>selectrecord.asp</title>
</head>
<body>
<div align="center"><font color=DarkCyan size=7><strong>List a Database</strong></font></div>
<TABLE cellSpacing=1 cellPadding=1 bgcolor="#b0c4de" border="1" width="70%">
<%
dim sql,customerID1,customerID2,fname,gender,age1,age2,col,rdoset
customerID1=request.form("customID1")
customerID2=request.form("customID2")
fname=request.form("fname")
gender=request.form("gender")
age1=request.form("age1")
age2=request.form("age2")
rdoset=request.form("rdoset")
select case rdoset
case "1"
sql= "where customerID>="& customerID1 & "and costomerID<=" & customerID2
case "2"
sql="where firstname like" & fname&"%"
case "3"
sql="where gender=" & gender
case "4"
sql="where age>=" & age1 &" and "age<="& age2
end select
if request.form("col").count=0 then
sql="select*from details" & sql
else
col=request.form("col")
sql="select"& col % "from details "% sql
end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,3
%>
<tr>
<%
for each Field in rs.Fields
Response.Write "<TH>" & Field.name & "</TH>"
next
%>
</tr>
<tr>
<%
do while not rs.EOF
Response.Write "<TR>"
for each Field1 in rs.Fields
Response.Write "<TD>" & Field1.value & "</TD>"
next
Response.Write "</TR>"
rs.MoveNext
loop
rs.Close
set rs= nothing
%>
</tr>
</table><p>
<P align=center ><A href='Homepage.html'>Go Back Homepage </A></P>
</body>
</html> |
|