请高手帮忙!解决execute的用法?
在example5.asp中的exec="insert into guestbook(name,tel,message)values('"+name+"',"+tel+",'"+message+"')"老是报错,能不能请高手帮忙改对一下,同时说一说exec怎么用啊!
先建立一个表单:
<form name="form1" method="post" action="example5.asp">
name <input type="text" name="name"><br>
tel <input type="text" name="tel"><br>
message <input type="text" name="message" value=""><br>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</form>
表单提交到example5.asp,下面是example5.asp的代码:
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("example3.mdb")
name=request.form("name")
tel=request.form("tel")
message=request.form("message")
exec="insert into guestbook(name,tel,message)values('"+name+"',"+tel+",'"+message+"')"
conn.execute exec
conn.close
set conn=nothing
response.write "记录添加成功!"
%>