版主;你的东东很管用,谢谢:
我是初学菜鸟,能不能帮个忙,帮我把下面的代码改对一下,在测试中总是报错“execut出错”我认为你能办到的,源代码是这样的:
先建立一个表单:
<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 "记录添加成功!"
%>
我是初学菜鸟,能不能帮个忙,帮我把下面的代码改对一下,在测试中总是报错“execut出错”我认为你能办到的,源代码是这样的:
先建立一个表单:
<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 "记录添加成功!"
%>