珠海王森西点学校学费:javascript+asp动态网页问题?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/06 16:17:52
请各位高手帮忙.程序如下:
<%
dim conn
dim connstr
on error resume next
connstr="provider=sql....."
set conn=server.createobject("adodb.connection")
if err then
err.clear
else
conn.open connstr
if err then
err.clear
end if
%>
其中我不明白on error resume next,if err then
err.clear
else
conn.open connstr
if err then
err.clear
end if
本人是个菜鸟,请大家指教.

on error resume next
是指asp程序产生错误的时候不要停止,继续执行

if err then 如果产生错误执行以下语句
err.clear 清除错误
else 其他的情况,即如果没有错误产生将执行以下语句
conn.open connstr 这句我也不太明白,大概是将connstr的值赋予conn对象执行
if err then 跟1-3行的作用一样
err.clear
end if