asp记录集对象的
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%option explicit%>
<!--#include file="conn.asp"-->
<%
dim str1,str2,str3,str4,rs
str1=trim(request.Form("文章类别"))
str2=trim(request.Form("文章作者"))
str3=trim(request.Form("文章主题"))
str4=trim(request.Form("文章内容"))
'判断
if request.querystring("action")<>"" then
if str1<>"" and str2<>"" and str3<>"" and str4<>"" then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="insert into tab_article(Aclass,Aauthor,Atitle,Acontent) values("&str1&",'"&str2&"','"&str3&"','"&str4&"')"
rs.open sql,conn,1,3
end if
end if
rs.close
set rs=nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.button {width:60px;
margin-right:10px;}
-->
</style>
</head>
<body>
<p style="font-weight:bolder;" align="center">添加文章</p>
<form method="post" action="?action=true"/>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td width="30%" height="30" bgcolor="#FFFFFF">文章类别:</td>
<td height="30" bgcolor="#FFFFFF">
<select name="文章类别">
<option selected="selected">选择类别</option>
<%
dim rs_new,sql
set rs_new=server.CreateObject("adodb.recordset")
sql="select * from tab_article_class"
rs_new.open sql,conn,1,1
do while not rs_new.eof
%>
<option value="<%=rs_new("id")%>"><%=rs_new("Acname")%></option>
<%
rs_new.movenext
loop
rs_new.close
set rs_new=nothing
conn.close
set conn=nothing
%>
</select>
</td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF">文章作者:</td>
<td height="30" bgcolor="#FFFFFF"><input type="text" name="文章作者" size="25"/></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF">文章主题:</td>
<td height="30" bgcolor="#FFFFFF"><input type="text" name="文章主题" size="25"/></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF">文章内容:</td>
<td height="30" bgcolor="#FFFFFF"><textarea name="文章内容" cols="40" rows="6">
</textarea></td>
</tr>
<tr>
<td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="提交" value="修改" class="button"/>
<input type="button" name="返回" value="返回" class="button" onclick="javascript:window.location.href='index_2.asp'" /></td>
</tr>
</table>
</form>
</body>
</html>为什么总是显示对象关闭,不允许操作,而且我想问一下,代码里面的这句话有错吗?
sql="insert into tab_article(Aclass,Aauthor,Atitle,Acontent) values("&str1&",'"&str2&"','"&str3&"','"&str4&"')"
rs.open sql,conn,1,3