#12003/11/5 22:18:01
这个程序为什么不能运行?哪位高手帮忙?
<%
dim i,j
dim email
dim judge
email=request.form("email")
//定义变量,将表单中文本框enail的内容赋给变量email
if email="" than
reaponse.write("请填写e-mail地址")
//如果文本框为空,则返回提示信息.
else
for i=2 to len(email)
if mid(email,i,a)="@" than
if mid(email,i+1,1)="." than
judge=true
end if
else
judge=false
end if
next
if judge=false than
response.write("请输入正确的e-mail地址")
else
//如果文本框不为空,则检验输入的email地址是否符合标准,用mid函数首先判断是否包含
//符号@,然后判断后面是否有".",根据不同的结果返回不同的值.
set conn=server.createobject("adodb.connection")
conn.open"driver={Microsoft Access Driver(*.mdb};dbq="&server.mappath("emaillist.mdb")
set rs=server.createobject("adodb.recordset")
SQL="selsct * from email where email='"&email&"'"
rs.open SQL,conn,3,3
//检验通过后,打开数据库文件emaillist.mdb,在表email中选择字段值与变量email
//形同的所有字段的记录,初始化数据库.
if not rs.eof then
response.write("你的邮件地址已经在邮件列表中了!
感谢你对本站的支持")
rs.close
set rs=nothing
//将当前系统时间赋给变量nowtime
SQL="insert into email values ('"&email&"','"&nowtime"')"
conn.execute SQL
conn.close
set conn=nothing
response.write("你的邮件地址已经写入到邮件列表中了,你将定期的收到本站的最新更新消息
感谢你对本站的支持")
//如果记录为空,则将变量email与nowtime的值添加到数据库中,然后返回提示信息。
end if
end if
end if
%>