标题:[求助]大家帮忙看看好么?
只看楼主
zmyzzz
Rank: 1
等 级:新手上路
帖 子:145
专家分:0
注 册:2005-9-21
 问题点数:0 回复次数:2 
[求助]大家帮忙看看好么?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
option explicit
dim conn,db,rs,sql,sgren,sgtime,sgphone,sgzhuti,sgzhuangtai,zaphone,zatime,fenleid,fenleix
dim sgneirong
db="/mdb/login.mdb"
sgren=Session("username")
sgtime=request.form("sgtime")
sgphone=Session("uphone")
sgzhuti=request.form("textzhuti")
sgneirong=request.form("textneirong")
sgneirong=replace(sgneirong,chr(13),"<br>")'替换回车
sgneirong=replace(sgneirong," ","&nbsp;&nbsp;")'替换空格
sgzhuangtai=request.form("sgzhuangtai")
zaphone=request.form("zaphone")
zatime=request.form("zatime")
fenleid=request.form("feileid")
fenleix=request.form("feileix")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
sql="select * from shengao1 where zhuti='"&sgzhuti&"'"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,2
if not rs.eof then
%>
<style type="text/css">
<!--
.style1 {
font-family: "宋体";
font-size: 10pt;
}
.style2 {color: #FF0000}
body {
background-image: url(../../../img/beijing.gif);
}
-->
</style>
<span class="style1">对不起,您所发布申告的主题重复,请检查是否重复或者修改主题!
<%
else
rs.addnew
rs("name")=sgren
rs("phone")=sgphone
rs("zhuti")=sgzhuti
rs("miaoshu")=sgneirong
rs("date_time")=sgtime
rs("xulie")=sgzhuangtai
rs("gonghao")=Session("user")
rs("zaphone")=zaphone
rs("zatime")=zatime
rs("fenleid")=fenleid
rs("fenleix")=fenleix
rs.update
%>
<%
end if
rs.close
conn.close
set conn=nothing
%>
</p>
</span>
<p>
<span class="style1">障碍:<span class="style2"><%=sgzhuti%></span>添加成功,请<a href="../../../loginok.asp">返回主页</a>!</span>

</p>

他总是提示我字段shengao1.miaoshu不能是零长度的字符串
是不是我那里写的有问题啊??
昨天还可以用呢

搜索更多相关主题的帖子: sql blank option target 
2005-11-02 15:43
zwjing0125
Rank: 1
等 级:新手上路
帖 子:61
专家分:0
注 册:2005-10-9
得分:0 
是你数据库设置的原因,将"是否允许为空"改为是就可以了
2005-11-02 15:56
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
或者给miaoshu赋初值

2005-11-02 16:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-32330-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.101484 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved