一个投票管理程序的问题
添加投票add.asp
<%
if request( "actions ")= "1 " then
title=trim(request( "titles "))
if request( "current ")= "1 " then
cu=true
else
cu=false
end if
if request( "choice ")= "1 " then
choi=false
else
choi=true
end if
if title= " " or len(title)> 200 then
response.write " <script language= 'javascript '> alert( '主题内容不能为空或大于指定字数! ');history.go(-1); </script> "
else
set rs=server.CreateObject( "adodb.recordset ")
sql= "select * from title where id=null "
rs.open sqlstr,conn,1,3
rs.addnew
rs( "title ")=title
rs( "current ")=cu
rs( "choice ")=choi
rs.update
response.write " <script language= 'javascript '> alert( '主题添加成功!请进入编辑页面添加选项 ');window.location.href= 'manage.asp '; </script> "
end if
end if
%>
<table width= "70% " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td height= "63 " valign= "bottom "> <div align= "center "> 添加投票标题: </div> </td>
</tr>
</table>
<form name= "form1 " method= "post " action= " ">
<table width= "70% " border= "0 " align= "center " cellpadding= "2 " cellspacing= "1 " bgcolor= "#000000 ">
<tr>
<td width= "26% " height= "14 " bgcolor= "#FFF4C8 "> <div align= "center "> 标题内容 </div> </td>
<td width= "74% " bgcolor= "#D7F2FF "> <textarea name= "titles " cols= "30 " rows= "4 " id= "titles "> </textarea>
小于200字符 </td>
</tr>
<tr>
<td width= "26% " height= "7 " bgcolor= "#FFF4C8 "> <div align= "center "> 单选/多选 </div> </td>
<td bgcolor= "#D7F2FF "> <input name= "choice " type= "radio " value= "1 " checked>
单选
<input type= "radio " name= "choice " value= "2 ">
多选 </td>
</tr>
<tr bgcolor= "#FFFFFF ">
<td colspan= "2 "> <div align= "center ">
<input name= "actions " type= "hidden " id= "actions " value= "1 ">
<input type= "submit " name= "Submit " value= "提交 ">
<input type= "reset " name= "Submit2 " value= "重置 ">
</div> </td>
</tr>
</table>
</form>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<!--#include file= "bottom.asp "-->
提示第19行有问题 错误提示如下:
(第19行也就是 rs.open sqlstr,conn,1,3)
技术信息(用于支持人员)
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/ttpp/add.asp, 第 19 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
POST 55 ??? /ttpp/add.asp
POST Data:
titles=111231231&choice=1&actions=1&Submit=%CC%E1%BD%BB
[解决办法]
sql= "select * from title where id=null "
MS SQL : "select * from title where id is null "
Access: "select * from title where id = ' ' "
[解决办法]
老大讲的我认同!!!~~~~