注册 登录
编程论坛 ASP技术论坛

Microsoft VBScript 运行时错误 (0x800A01A8)

hanzhu3366 发布于 2007-12-26 15:20, 784 次点击
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<p>
  <% dim xm,dh,nl,ah %>
</p>
<p>
你的个人信息是:
  
</p>
<p>姓名:
  <% = request.Form("xm")%>
</p>
<p>电话:
  <% = request.Form("dh")%>  
<p>年龄:
  <% = request.Form("nl")%>
<p>爱好:
 <% = request.Form("ah")%>
<p>
<!--#include file="conn.asp"-->
<%
exec="insert into text(xm,dh,nl,ah)values('"&xm&"','"&dh&"','"&nl&"','"&ah&"')"
conn.execute exec
conn.close
set conn=nothing
response.Redirect"liuyan3.asp"
%>
<p>
</body>
</html>


conn.execute exec  缺少对象,怎么办??
4 回复
#2
不惑2007-12-26 16:28
没有打开数据库的语句,就是conn你是什么时候打开的?
#3
hangxj2007-12-27 17:21
exec="insert into text(xm,dh,nl,ah)values('"&xm&"','"&dh&"','"&nl&"','"&ah&"')"

values前面有空格吗?
#4
yms1232007-12-27 18:08
exec="insert into [text](xm,dh,nl,ah)values('"&xm&"','"&dh&"','"&nl&"','"&ah&"')"
text是数据库关键字做表名要加中括号区分
#5
hanzhu33662007-12-27 21:40
谢谢大家!
1