Microsoft VBScript 运行时错误 '800a000d' 类型不匹配: 'CheckStr'
下面为数据库列表ID ProductNameCH ViewFlagCH SortID SortPath ProductNo ProductModel N_Price P_Price Stock UnitCH CommendFlag NewFlag MakerCH GroupID Exclusive SmallPic BigPic ContentCH ClickNumber AddTime UpdateTime attribute1CH attribute1CH_value SeoKeywordsCH SeoDescriptionCH
下面为代码,在第243形为何出提示出现,红色地方为出错行数!
Microsoft VBScript 运行时错误 '800a000d'
类型不匹配: 'CheckStr'
\admin\ProductEdit.asp, line 243
<%@ LANGUAGE = VBScript.Encode %>
<HTML xmlns="http://www.
<HEAD>
<META HTTP-EQUIV="ContentCH-Type" ContentCH="text/html; charset=gb2312" />
<TITLE>新闻编辑</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="Admin_htmlconfig.asp"-->
<BODY>
<script language="javascript">
<!--
function setpic(){
var arr = showModalDialog("../Editor/customDialog/img.htm", "", "dialogWidth:30em; dialogHeight:26em; status:0;help=no");
if (arr ==null){
alert("系统提示:当前没有上传图片,界面预览图为空,用户可以重新上传图片!");
}
if (arr !=null){
editForm.SmallPic.value=arr;
}
}
function setbpic(){
var arr = showModalDialog("../Editor/customDialog/img.htm", "", "dialogWidth:30em; dialogHeight:26em; status:0;help=no");
if (arr ==null){
alert("系统提示:当前没有上传图片,界面预览图为空,用户可以重新上传图片!");
}
if (arr !=null){
editForm.BigPic.value=arr;
}
}
//-->
</script>
<%
if Instr(session("AdminPurview"),"|13,")=0 then
response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
response.end
end if
dim Result
Result=request.QueryString("Result")
dim ID,ProductNameCh,ViewFlagCh,SortNameCH,SortID,SortPath
dim ProductNo,ProductModel,N_Price,P_Price,Stock,UnitCh,MakerCh,CommendFlag,NewFlag,GroupID,GroupIdName,Exclusive,SeoKeywordsCH,SeoDescriptionCH
dim BigPic,SmallPic,ContentCH
ID=request.QueryString("ID")
call ProductEdit()
call AdminSiteInfo
%>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<th>产品检索及分类查看:添加,修改,删除产品信息</th>
</tr>
<tr>
<td height="24" align="center" nowrap="nowrap" class="forumrow"><a href="ProductEdit.asp?Result=Add" onclick='changeAdminFlag("添加产品信息")'>添加产品信息</a><font color="#0000FF"> | </font><a href="ProductList.asp" onclick='changeAdminFlag("产品列表")'>查看所有产品信息</a> | </font><a href="ProductSort.asp?Action=Add&ParentID=0" onclick='changeAdminFlag("产品列表")'>添加产品类别</a> | </font><a href="OrderList.asp" onclick='changeAdminFlag("产品列表")'>查看订单信息</a><font color="#0000FF"> | </font><a href="Admin_htmlsort.asp" onclick='changeAdminFlag("生成其他信息分类页面")'>生成产品分类页面</a><font color="#0000FF"> | </font><a href="Admin_htmlpro.asp" onclick='changeAdminFlag("生成其他信息详细页面")'>生成产品详细页面</a></td>
</tr>
</table>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
<form name="editForm" method="post" action="ProductEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
<tr>
<th height="22" colspan="2">【<%If Result = "Add" then%>添加<%ElseIf Result = "Modify" then%>修改<%End If%>产品】</th>
</tr>
<tr>
<td width="20%" align="right" class="forumRow">中文标题:</td>
<td width="80%" class="forumRowHighlight"><input name="ProductNameCH" type="text" id="ProductNameCH" style="width: 280" value="<%=ProductNameCH%>" maxlength="250">
是否显示:
<input name="ViewFlagCH" type="checkbox" value="1" checked="checked" <%if ViewFlagCH then response.write ("checked")%>>
<font color="red">*</font> <input type="button" name="btn" value="复制标题" title="复制标题到中文:MetaDescription、MetaKeywords" onClick="CopyWebTitleCH(document.editForm.ProductNameCH.value);"></td>
</tr>
<tr>
<td align="right" class="forumRow">中文MetaKeywords:</td>
<td class="forumRowHighlight"><input name="SeoKeywordsCH" type="text" id="SeoKeywordsCH" style="width: 500" value="<%=SeoKeywordsCH%>" maxlength="250"></td>
</tr>
<tr>
<td align="right" class="forumRow">中文MetaDescription:</td>
<td class="forumRowHighlight"><input name="SeoDescriptionCH" type="text" id="SeoDescriptionCH" style="width: 500" value="<%=SeoDescriptionCH%>" maxlength="250"></td>
</tr>
<tr>
<td align="right" class="forumRow">产品类别:</td>
<td class="forumRowHighlight"><input name="SortID" type="text" id="SortID" style="width: 18; background-color:#fffff0" value="<%=SortID%>" readonly>
<input name="SortPath" type="text" id="SortPath" style="width: 70; background-color:#fffff0" value="<%=SortPath%>" readonly>
<input name="SortNameCH" type="text" id="SortNameCH" value="<%=SortNameCH%>" style="width: 180; background-color:#fffff0" readonly>
<a href="javaScript:OpenScript('SelectSort.asp?Result=Products',500,500,'')">选择类别</a> <font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">产品编号:</td>
<td class="forumRowHighlight"><input name="ProductNo" type="text" style="width: 180;" value="<%=ProductNo%>" maxlength="180">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">产品型号:</td>
<td class="forumRowHighlight"><input name="ProductModel" type="text" style="width: 180;" value="<%=ProductModel%>" maxlength="180">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">市场价格:</td>
<td class="forumRowHighlight"><input name="N_Price" type="text" style="width: 80;" value="<%=N_Price%>" maxlength="80">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">批发价格:</td>
<td class="forumRowHighlight"><input name="P_Price" type="text" style="width: 80;" value="<%=P_Price%>" maxlength="80">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">库存数量:</td>
<td class="forumRowHighlight"><input name="Stock" type="text" style="width: 80;" value="<%=Stock%>" maxlength="80">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">计价单位[中文]:</td>
<td class="forumRowHighlight"><input name="UnitCH" type="text" style="width: 80;" value="<%=UnitCH%>" maxlength="80">
<a href="javascript:" onClick="document.editForm.UnitCH.value='件'">件</a> <a href="javascript:" onClick="document.editForm.UnitCH.value='套'">套</a> <a href="javascript:" onClick="document.editForm.UnitCH.value='个'">个</a> <a href="javascript:" onClick="document.editForm.UnitCH.value='只'">只</a> <a href="javascript:" onClick="document.editForm.UnitCH.value='台'">台</a> <font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">出品公司[中文]:</td>
<td class="forumRowHighlight"><input name="MakerCH" type="text" style="width: 250;" value="<%=MakerCH%>" maxlength="250">
<a href="javascript:" onClick="document.editForm.MakerCH.value='<%=AdminSiteTitleCH%>'"><%=AdminSiteTitleCH%></a> <font color="red">*</font></td>
</tr>
<%
if Result="Modify" then
set rs = server.createobject("adodb.recordset")
sql="select * from LiangJingCMS_Products where ID="& ID
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write ("<center>数据库记录读取错误!</center>")
response.end
end If
if rs("attribute1CH")<>"" and rs("attribute1CH_value")<>"" then
attribute1CH_1=Split(rs("attribute1CH"),"§§§")
attribute1CH_value_1=Split(rs("attribute1CH_value"),"§§§")
Num_1=ubound(attribute1CH_1)+1
Else
Num_1=0
End If
rs.close
set rs=Nothing
Else
Num_1=0
End If
%>
<tr>
<td align="right" class="forumRow">中文自定义产品属性:</td>
<td class="forumRowHighlight"><input name="Num_1" type="text" id="Num_1" value="<%=Num_1%>" size="5" />个 <input name="button2" type="button" id="button2" value="设置" onClick="num_1()" /> <input type="button" name="button7" id="button7" value="增加一个" onClick="num_1_1()" />
<br>
<span id="num_1_str">
<%For i=0 to (Num_1-1)%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28">属性名称:
<input name="attributeCH<%=i+1%>" type="text" id="attributeCH<%=i+1%>" value="<%=attribute1CH_1(i)%>" size="18" />
属性值:
<input name="attributeCH<%=i+1%>_value" type="text" id="attributeCH<%=i+1%>_value" value="<%=attribute1CH_value_1(i)%>" size="50" /></td>
</tr>
</table>
<%Next%>
</span> </td>
</tr>
<tr>
<td align="right" class="forumRow">状 态:</td>
<td class="forumRowHighlight"><input name="CommendFlag" type="checkbox" style="HEIGHT: 13px;WIDTH: 13px;" value="1" <%if CommendFlag then response.write ("checked")%>> 推荐 <input name="NewFlag" type="checkbox" value="1" style="HEIGHT: 13px;WIDTH: 13px;" <%if NewFlag then response.write ("checked")%>> 最新</td>
</tr>
<tr>
<td align="right" class="forumRow">阅读权限:</td>
<td class="forumRowHighlight"><select name="GroupID">
<% call SelectGroup() %>
</select>
<input name="Exclusive" type="radio" value=">=" <%if Exclusive="" or Exclusive=">=" then response.write ("checked")%>>
隶属
<input type="radio" <%if Exclusive="=" then response.write ("checked")%> name="Exclusive" value="=">
专属(隶属:权限值≥可查看,专属:权限值=可查看)</td>
</tr>
<tr>
<td align="right" class="forumRow">产品小图:</td>
<td class="forumRowHighlight"><input name="SmallPic" type="text" style="width: 250;" value="<%=SmallPic%>" maxlength="250">
<input type="button" value="上传图片" onClick="setpic();">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">产品大图:</td>
<td class="forumRowHighlight"><input name="BigPic" type="text" style="width: 250;" value="<%=BigPic%>" maxlength="250">
<input type="button" value="上传图片" onClick="setbpic();">
<font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">产品内容:</td>
<td class="forumRowHighlight"><textarea name="ContentCH" id="ContentCH" style="display:none"><%=Server.HTMLEncode((ContentCH))%></textarea>
<iframe ID="eWebEditor1" src="../Editor/ewebeditor.htm?id=ContentCH&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe></td>
</tr> <tr>
<td align="right" class="forumRow"></td>
<td class="forumRowHighlight"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" value="保存">
<input type="button" value="返回上一页" onClick="history.back(-1)"></td>
</tr>
</form>
</table>
</BODY>
</HTML>
<%
sub ProductEdit()
dim Action,rsRepeat,rs,sql
Action=request.QueryString("Action")
if Action="SaveEdit" then
set rs = server.createobject("adodb.recordset")
if len(trim(request.Form("ProductNameCh")))<1 then
response.write ("<script language=javascript> alert('名称为必填项目!');history.back(-1);</script>")
end if
if Result="Add" Then
set rsRepeat = conn.execute("select ProductNo from LiangJingCMS_Products where ProductNo='" & trim(Request.Form("ProductNo")) & "'")
if not (rsRepeat.bof and rsRepeat.eof) then
response.write "<script language='javascript'>alert('" & trim(Request.Form("ProductNo")) & "产品编号已存在!');history.back(-1);</script>"
response.End
End If
rsRepeat.close
set rsRepeat=Nothing
sql="select * from LiangJingCMS_Products"
rs.open sql,conn,1,3
rs.addnew
rs("ProductNameCh")=trim(Request.Form("ProductNameCh"))
if Request.Form("ViewFlagCh")=1 then
rs("ViewFlagCh")=Request.Form("ViewFlagCh")
else
rs("ViewFlagCh")=0
end if
if Request.Form("SortID")="" and Request.Form("SortPath")="" then
response.write ("<script language='javascript'>alert('请选择所属分类!');history.back(-1);</script>")
response.end
else
rs("SortID")=Request.Form("SortID")
rs("SortPath")=Request.Form("SortPath")
end if
rs("ContentCh")=trim(Request.Form("ContentCh"))
GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
rs("GroupID")=GroupIdName(0)
rs("Exclusive")=trim(Request.Form("Exclusive"))
rs("BigPic")=trim(Request.Form("BigPic"))
rs("SmallPic")=trim(Request.Form("SmallPic"))
rs("ContentCh")=Request.Form("ContentCh")
rs("AddTime")=now()
rs("UpdateTime")=now()
Num_1=CheckStr(Request.Form("Num_1"),1)
if Num_1="" then Num_1=0
if Num_1>0 then
For i=1 to Num_1
If CheckStr(Request.Form("attributeCH"&i),0)<>"" and CheckStr(Request.Form("attributeCH"&i&"_value"),0)<>"" Then
If attribute1CH="" then
attribute1CH=CheckStr(Request.Form("attributeCH"&i),0)
attribute1CH_value=CheckStr(Request.Form("attributeCH"&i&"_value"),0)
Else
attribute1CH=attribute1CH&"§§§"&CheckStr(Request.Form("attributeCH"&i),0)
attribute1CH_value=attribute1CH_value&"§§§"&CheckStr(Request.Form("attributeCH"&i&"_value"),0)
End if
End If
Next
end if
rs("attribute1CH")=attribute1CH
rs("attribute1CH_value")=attribute1CH_value
rs("SeoKeywordsCH")=trim(Request.Form("SeoKeywordsCH"))
rs("SeoDescriptionCH")=trim(Request.Form("SeoDescriptionCH"))
rs.update
rs.close
set rs=Nothing
set rs=server.createobject("adodb.recordset")
sql="select top 1 ID from LiangJingCMS_Products order by ID desc"
rs.open sql,conn,1,1
ID=rs("ID")
rs.close
set rs=Nothing
if ISHTML = 1 then
call htmll("/CH/","/CH/",""&ProName&""&Separated&""&ID&"."&HTMLName&"","ProductView.asp","ID=",ID,"","")
End If
End If
if Result="Modify" then
sql="select * from LiangJingCMS_Products where ID="&ID
rs.open sql,conn,1,3
rs("ProductNameCh")=trim(Request.Form("ProductNameCh"))
if Request.Form("ViewFlagCh")=1 then
rs("ViewFlagCh")=Request.Form("ViewFlagCh")
else
rs("ViewFlagCh")=0
end if
rs("SortID")=Request.Form("SortID")
rs("SortPath")=Request.Form("SortPath")
rs("ProductNo")=trim(Request.Form("ProductNo"))
rs("ProductModel")=trim(Request.Form("ProductModel"))
rs("N_Price")=Round(trim(Request.Form("N_Price")),2)
rs("P_Price")=Round(trim(Request.Form("P_Price")),2)
rs("Stock")=Round(trim(Request.Form("Stock")),2)
rs("UnitCh")=trim(Request.Form("UnitCh"))
rs("MakerCh")=trim(Request.Form("MakerCh"))
if Request.Form("CommendFlag")=1 then
rs("CommendFlag")=Request.Form("CommendFlag")
else
rs("CommendFlag")=0
end if
if Request.Form("NewFlag")=1 then
rs("NewFlag")=Request.Form("NewFlag")
else
rs("NewFlag")=0
end if
GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
rs("GroupID")=GroupIdName(0)
rs("Exclusive")=trim(Request.Form("Exclusive"))
rs("BigPic")=trim(Request.Form("BigPic"))
rs("SmallPic")=trim(Request.Form("SmallPic"))
rs("ContentCh")=Request.Form("ContentCh")
rs("UpdateTime")=now()
Num_1=CheckStr(Request.Form("Num_1"),1)
if Num_1="" then Num_1=0
if Num_1>0 then
For i=1 to Num_1
If CheckStr(Request.Form("attributeCH"&i),0)<>"" and CheckStr(Request.Form("attributeCH"&i&"_value"),0)<>"" Then
If attribute1CH="" then
attribute1CH=CheckStr(Request.Form("attributeCH"&i),0)
attribute1CH_value=CheckStr(Request.Form("attributeCH"&i&"_value"),0)
Else
attribute1CH=attribute1CH&"§§§"&CheckStr(Request.Form("attributeCH"&i),0)
attribute1CH_value=attribute1CH_value&"§§§"&CheckStr(Request.Form("attributeCH"&i&"_value"),0)
End if
End If
Next
end if
rs("attribute1CH")=attribute1CH
rs("attribute1CH_value")=attribute1CH_value
rs("SeoKeywordsCH")=trim(Request.Form("SeoKeywordsCH"))
rs("SeoDescriptionCH")=trim(Request.Form("SeoDescriptionCH"))
rs.update
rs.close
set rs=Nothing
if ISHTML = 1 then
call htmll("/CH/","/CH/",""&ProName&""&Separated&""&ID&"."&HTMLName&"","ProductView.asp","ID=",ID,"","")
End If
End If
if ISHTML = 1 then
response.write "<script language='javascript'>alert('设置成功,相关静态页面已更新!');location.replace('ProductList.asp');</script>"
Else
response.write "<script language='javascript'>alert('设置成功!');location.replace('ProductList.asp');</script>"
End If
else
if Result="Modify" then
set rs = server.createobject("adodb.recordset")
sql="select * from LiangJingCMS_Products where ID="& ID
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write ("<center>数据库记录读取错误!</center>")
response.end
end if
ProductNameCh=rs("ProductNameCh")
ViewFlagCh=rs("ViewFlagCh")
SortNameCH=SortText(rs("SortID"))
SortID=rs("SortID")
SortPath=rs("SortPath")
ProductNo=rs("ProductNo")
ProductModel=rs("ProductModel")
N_Price=rs("N_Price")
P_Price=rs("P_Price")
Stock=rs("Stock")
UnitCh=rs("UnitCh")
MakerCh=rs("MakerCh")
CommendFlag=rs("CommendFlag")
NewFlag=rs("NewFlag")
GroupID=rs("GroupID")
Exclusive=rs("Exclusive")
BigPic=rs("BigPic")
SmallPic=rs("SmallPic")
ContentCh=rs("ContentCh")
SeoKeywordsCH=rs("SeoKeywordsCH")
SeoDescriptionCH=rs("SeoDescriptionCH")
rs.close
set rs=nothing
else
randomize timer
ProductNo=Hour(now)&Minute(now)&Second(now)&"-"&int(900*rnd)+100
Stock=10000
end if
end if
end sub
sub SelectGroup()
dim rs,sql
set rs = server.createobject("adodb.recordset")
sql="select GroupID,GroupNameCH from LiangJingCMS_MemGroup"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write("未设组别")
end if
while not rs.eof
response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupNameCH")&"'")
if GroupID=rs("GroupID") then response.write ("selected")
response.write(">"&rs("GroupNameCH")&"</option>")
rs.movenext
wend
rs.close
set rs=nothing
end sub
Function SortText(ID)
Dim rs,sql
Set rs=server.CreateObject("adodb.recordset")
sql="Select * From LiangJingCMS_ProductSort where ID="&ID
rs.open sql,conn,1,1
SortText=rs("SortNameCH")
rs.close
set rs=nothing
End Function
%>