我运行写列代码的时候遇到这样的问题:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
请高手指点呀.谢谢拉
<%response.buffer=true%>
<!--include file="connection.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发表新文章</title>
</head>
<body>
<h2 align="center">发表新文章 </h2>
<center>
<table width="90%" border="0" cellspacing="3" cellpadding="0">
<form name="form1" method="post" action="">
<tr>
<td width="23%">主题:</td>
<td width="77%"><input name="title" type="text" id="title" size="60">
**</td>
</tr>
<tr>
<td>内容:</td>
<td><textarea name="body" cols="60" rows="4" id="body"></textarea></td>
</tr>
<tr>
<td>姓名:</td>
<td><input name="user_name" type="text" id="user_name" size="20">
**</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交"></td>
</tr>
</form></table>
</center>
<div align="center"><a href="index.asp?page_no=<%=session("page_no")%>">返回首页</a>
<%
'如果文章标题和作者姓名不为空,就执行下面操作
if request("title")<>"" and request("user_name")<>"" then
dim title,body,layer,parent_id,child,hits,ip,user_name '定义变量方便使用
title=request("title")
body=request("body")
user_name=request("username")
layer=1 '这是第一层
parent_id=0 '因为是第一层,故编号设为0
child=0 '回复文章数目为0
hits=0 '点击数为0
ip=request.servervariables("remote_addr") '作者IP地址
'以下将文章保存到数据库
dim sql,svalues
sql="insert into bbs(title,layer,parent_id,child,hits,ip,user_name,submit_date"
svalues="values('"&title&"',"&layer&","&parent_id&","&child&","&hits&",'"&ip&"','"&user_name&"','"&date()&"'"
if body<>"" then
sql=sql&",body"
svalues=svalues&","&"'"&body&"'"
end if
sql=sql&")"&svalues&")"
db.execute(sql)
db.close
response.redirect "index.asp?page_no="&request.querystring("page_no")
end if
%>
</div>
</body>
</html>