库中找不到该记录,但没出现报错语句
我想让程序实现若在库中找不到该记录,报错,代码如下,但当库中找不到该记录时,页面上是什么都没有,而不是我所期望的报"无资料"的语句,请教!
mysql="select dwmc from mytable where xm='"& name &"'" &" and xh='" & code & "'"
on error resume next
set rst=cnn.execute(mysql,1,1)
%>
<html>
<head>
<title>查询系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
if err.number<>0 then
response.write"hihi"
response.write "<font color='#66CC66' size='5' face='隶书'>无资料</font>"
response.end
end if
do while not (rst.bof and rst.eof)
rst.close
set rst=nothing
cnn.close
set cnn=nothing
%>