ASP复选框写入ACCESS数据库问题

选中复选框提示这样的错误:Provider错误'80020005'类型不匹配。/admin/Bs_products.asp,行46代码如下:<!--#includefil... 选中复选框提示这样的错误:
Provider 错误 '80020005'
类型不匹配。
/admin/Bs_products.asp,行 46

代码如下:
<!--#include file="Conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加产品</title>
<script language=javascript>
<!--
function CheckForm()
{
if(document.book.title.value=="")
{
alert("产品名称不能为空!");
document.book.title.focus();
return false;
}

if(document.book.size.value=="")
{
alert("产品规格不能为空!");
document.book.size.focus();
return false;
}

if(document.book.img.value=="")
{
alert("产品图片不能为空!");
document.book.img.focus();
return false;
}
}
//-->
</script>
<%
if request("act")="add" then
set rs=server.createobject("adodb.recordset")
sql="select * from products"
rs.open sql,conn,1,3
rs.addnew
rs("title")=request("title")
rs("size")=request("size")
rs("jg")=request("jg")
rs("img")=request("img")
rs("bid")=request("bid")
rs("typeid")=request("typeid")
rs("Pre")=request("Pre")
rs("desc")=request("desc")
rs.update
response.write("<SCRIPT language=JavaScript>alert('产品添加成功,点击返回继续添加!');javascript:history.go(Bs_products.asp)</SCRIPT>")
end if
%>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #333333;
}
a:hover {
text-decoration: none;
color: #FF6600;
}
a:active {
text-decoration: none;
color: #333333;
}
-->
</style></head>

<body>
<strong>添加产品</strong>
<form name="book" action="Bs_products.asp?act=add" method="post" onSubmit="return CheckForm();">
产品名称:
<label>
<input name="title" type="text" id="title" size="40" />
</label>
<br />
<br />
产品规格:
<label>
<input name="size" type="text" id="size" size="40" />
</label>
<br />
<br />
<label></label>
缩图地址:
<label>
<input name="img" type="text" id="img" size="40" />
</label>
<br />
<br />
产品价格:
<input name="jg" type="text" id="jg" />
<br />
<br />
产品大类:
<input name="bid" type="text" id="bid" size="5" maxlength="2" />
请对照右边大类列表序号填写,如果没有此分类可以为空,或先添加大类<br />
大类列表:
<select name="dalei" size="1" id="dalei">
<%
sql_pd = "Select * From mtype"
Set rs_pd=Server.CreateObject("Adodb.RecordSet")
rs_pd.Open sql_pd,Conn,1,1
%>
<%
Do While Not rs_pd.Eof
%>
<option>大类编号:<%=rs_pd("bid")%> | 大类名称:<%=rs_pd("mtype")%><br></option>
<%
rs_pd.MoveNext
Loop
%>
</select>
<br>
<br>
产品小类:
<input name="typeid" type="text" id="typeid" size="5" maxlength="3" />
请对照下面小类列表序号填写,如果没有此分类可以为空,或先添加小类 <br />
小类列表:
<select name="xiaolei" size="1" id="xiaolei">
<%
sql_px = "Select * From class_type"
Set rs_px=Server.CreateObject("Adodb.RecordSet")
rs_px.Open sql_px,Conn,1,1
%>
<%
Do While Not rs_px.Eof
%>
<option>所属大类编号:<%=rs_px("p_id")%>&
展开
 我来答
秋叶妈妈
2020-07-07 · TA获得超过3851个赞
知道大有可为答主
回答量:3027
采纳率:27%
帮助的人:430万
展开全部
rs("tg")=false
你在这就写了rs("tg")了当然找不到咯··
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式