主题:只要是相关建议就有分数可得——数据添加出了问题
本人菜鸟一个,特向各位高手求助,以下是我做的一个简单的表单提交,记录到数据库里,不想出了问题,特虚心请教
下面是add.asp程序:
<% @language =vbscript %>
<!--#inclue file="conn.asp"-->
<%
dim strsql,rs
strsql = "insert into book1(name,age,birthday) values('ddd','ttt','jjj')"
con.execute(strsql)
%>
<html>
<body>
<%
set rs = con.execute("select * from book1")
do while not rs.eof
response.write rs("name") & " " & rs("age") & " " & rs("birthday") & " " &
"<br>"
rs.movenext
loop
con.close
set rs = nothing
set con = nothing
%>
</body>
</html>
这是conn.asp程序:
<%
Option Explicit
Response.Expires = 0
dim con,strcon
set con = server.createobject("adodb.connection")
strcon = "provider = microsoft.jet.oledb.4.0;data source = " & server.mappath("guestbook.mdb")
con.open strcon
%>
表单程序:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="add.asp">
<p>姓名:
<input type="text" name="name">
</p>
<p>
年龄:
<input type="text" name="age">
</p>
<p>生日:
<input type="text" name="birthday">
<br>
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>
运行结果出来的是:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: ''
/add.asp,行6
请教各位高手,这种情况如何来解决,是那里出的问题?各位可以加我QQ:215271595
谢谢了
下面是add.asp程序:
<% @language =vbscript %>
<!--#inclue file="conn.asp"-->
<%
dim strsql,rs
strsql = "insert into book1(name,age,birthday) values('ddd','ttt','jjj')"
con.execute(strsql)
%>
<html>
<body>
<%
set rs = con.execute("select * from book1")
do while not rs.eof
response.write rs("name") & " " & rs("age") & " " & rs("birthday") & " " &
"<br>"
rs.movenext
loop
con.close
set rs = nothing
set con = nothing
%>
</body>
</html>
这是conn.asp程序:
<%
Option Explicit
Response.Expires = 0
dim con,strcon
set con = server.createobject("adodb.connection")
strcon = "provider = microsoft.jet.oledb.4.0;data source = " & server.mappath("guestbook.mdb")
con.open strcon
%>
表单程序:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="add.asp">
<p>姓名:
<input type="text" name="name">
</p>
<p>
年龄:
<input type="text" name="age">
</p>
<p>生日:
<input type="text" name="birthday">
<br>
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>
运行结果出来的是:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: ''
/add.asp,行6
请教各位高手,这种情况如何来解决,是那里出的问题?各位可以加我QQ:215271595
谢谢了