| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1224 人关注过本帖
标题:请教高手,为何一段代码(红色部分)无法将值写进数据库"huiyuan"
只看楼主 加入收藏
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
结帖率:55.56%
收藏
已结贴  问题点数:20 回复次数:15 
请教高手,为何一段代码(红色部分)无法将值写进数据库"huiyuan"
<%
'$Id: producit_renwu.asp 2009-08-17 $
if request.Cookies("shiwei_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%  
  response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->

<html>
<head>
<title><%=dianming%> - 在录项目批量稽核</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
    background-color:#FFFFFF;
}
</style>
</HEAD>

<BODY>
<%
if fla13="0" and request.Cookies("shiwei_id")<>"1" then
%>
<br><center>
<img src="../images/note.gif" align="absmiddle">&nbsp;<font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%  
  response.end
end if
%>

<%
if request("hid1")="ok" then
nowselldate=request("selldate")

for x=1 to maxproduit
nowguige=request("guige"&x)
nowid_ku=request("id_ku"&x)
nowhuohao=request("huohao"&x)
nowtitle=request("title"&x)
if nowprice="" then
  nowprice=0
end if
if nowhuohao<>"单击选择项目" and nowshulian<>"" then
set rs_produit=conn.execute("select * from produit where huohao='"&nowhuohao&"'")
set rs=server.createobject("ADODB.RecordSet")
sql="select * from produit where huohao='"&nowhuohao&"' and id_ku="&nowid_ku
rs.open sql,conn,1,3
if rs.eof then
%>
<script language="javascript">
alert("<%=rs_ku("ku")%> 中没有项目 <%=rs_produit("title")%>!")
window.history.go(-1)
</script>

<%
  response.end
  exit for
end if
end if
next

for x=1 to maxproduit
nowselldate=request("selldate")
nowdanwei=request("danwei")
nowguige=request("guige"&x)
nowid_ku=request("id_ku"&x)
nowhuohao=request("huohao"&x)
nowtitle=request("title"&x)
if nowhuohao<>"单击选择项目" then
set rs_produit=conn.execute("select * from produit where huohao='"&nowhuohao&"'")
set rs=server.createobject("ADODB.RecordSet")
sql="select * from produit where huohao='"&nowhuohao&"' and id_ku="&nowid_ku
rs.open sql,conn,1,3
rs("id_danwei")=nowdanwei
rs("duihuan")=nowselldate
if nowdanwei=109 then
rs("beizhu")=nowbeizhu
end if
if nowdanwei=110 then
rs("beizhu")="该项目已经完成GIS数据录入,经过系统数据比对,确认无误,请客响确认项目关联号线资料是否移交,如无异议,则请建设部门会同相关部门进行现场验收!"
end if
rs.update
rs.close

set rs=server.createobject("ADODB.RecordSet")
sql="select * from buy where huohao='"&nowhuohao&"' "
rs.open sql,conn,1,3
if nowdanwei=110 then
rs("isok")=true
end if
if nowdanwei=109 then
rs("isok")=false
rs("id_huiyuan")=55
end if
rs.update
rs.close
sql="select * from buy where huohao='"&nowhuohao&"' "
rs.open sql,conn,1,3
do while rs.eof=false
if nowdanwei=110 then
rs("isok")=true
end if
if nowdanwei=109 then
rs("isok")=false
end if
rs.movenext
loop
end if
next
%>
<%
sql="select * from [huiyuan]"
set rs = server.createobject("ADODB.RecordSet")
rs.open sql,conn,1,3
if nowdanwei=110 then
rs.close
set rs = nothing
end if
if nowdanwei=109 then
rs.addnew
if id_ku=140 then
rs("qq")="江苏三维"
end if
if id_ku=143 then
rs("qq")="无锡大同"
end if
if id_ku=142 then
rs("qq")="省建工"
end if
if id_ku=150 then
rs("qq")="江苏网盈"
end if
rs("username") = nowtitle
rs("xinbie") = "项目稽核"
rs("tel") = nowbeizhu
rs("address") = nowguige
rs("card") = nowhuohao
rs("id_zu") = nowid_zu
rs.update
rs.close
set rs = nothing
end if
%>
<script language="javascript">
alert("GIS数据稽核成功,请建设部门及时整改或者组织项目验收!")
</script>
<script language="javascript">
window.location.href="produit_move.asp"
</script>
<%
end if
%>
<script language="javascript">
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
    TempChar= InString.substring (Count, Count+1);
    if (RefString.indexOf (TempChar, 0)==-1)  
    return (false);
}
return (true);
}

function check1()
{
if (document.form1.huohao1.value=="单击选择项目")
{
alert("还没有选择项目!");
return false;
}
if (document.form1.shulian1.value=="")
{
alert("请输入数量!");
return false;
}
}
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td>
<img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;项目批量稽核,请注意选择竣工在录项目,注意系统提示进行下一步操作!</td>
      <td align="right"> </td>
    </tr>
  </table>
</td>
<td>
<img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
      <form name="form1" method="post">
      <tr>
        <td width="16%" align="right" height="30">请选择项目:</td>
        <td width="81%" class="category">
          <table cellpadding="0" cellspacing="0" width="100%" border=0>
            <%for x=1 to maxproduit%>
            <tr id="cailiaohan<%=x%>"<%if x<>1 then%> style="display:none;"<%end if%>>
              <td>
                <input name="huohao<%=x%>" readonly onClick="JavaScript:window.open('produit5.asp?form=form1&field=huohao<%=x%>&field2=title<%=x%>&field3=guige<%=x%>&span1=id_ku<%=x%>','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=853,height=470,top=176,left=161');" style="width:80px" value="单击选择项目" size="1">
                项目名称:
                <input type="text" name="title<%=x%>" style="width:150; height:18" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))">
                <font color="#FF0000">施工识别码</font>:
                <input type="password" name="id_ku<%=x%>" style="width:30; height:18" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))" size="50">            
                施工负责人:
                <input name="guige<%=x%>" style="width:40; height:18" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))" size="50">            
                <%if x<>maxproduit then%><span onClick="cailiaohan<%=(x+1)%>.style.display=''" style="cursor:hand;">
                <span onClick="cailiaohan<%=(x+1)%>.style.display=''" style="cursor:hand;">添加一个项目</span><%end if%>
                <%if x<>1 then%><input type="button" value="清除" onClick="huohao<%=x%>.value='单击选择项目';shulian<%=x%>.value='1';price<%=x%>.value=''" class="button"><%end if%>
                <%if x=1 then%><font color="#ff0000">*</font><%end if%>
                <div id="showshulian<%=x%>"></div>
              </td>
            </tr>        
            <%next%>        
          </table>
        </td>
      </tr>      
      <tr>
        <td align="right" height="30">项目稽核状态:</td>
        <td class="category">   
      <select name="danwei" onChange="form3.submit()" size="1">
      <option value="110" selected>录入待验</option>
        <option value="109">稽核有误</option>
      </select>    </td>
      </tr>
      <tr>
        <td align="right" height="30">项目稽核时间:</td>
        <td class="category">
          <input name="selldate" value="<%=date()%>" readonly style="width:150px">
          <img src="../images/date.gif" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:window.open('day.asp?form=form1&field=selldate&oldDate='+selldate.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=200,left=520');">
        </td>
      </tr>
             <tr>
        <td width="25%" height="30" align="right">反馈问题类型:</td>
        <td width="75%" class="category">
            <%
    sql="select * from zu_huiyuan order by id"
    set rs_zu=conn.execute(sql)
    if rs_zu.eof then
    %>
    <script language="javascript">
      alert("请先添加类型!")
      window.location.href="zu_add.asp"
    </script>
    <%
    response.end
    end if
    %>
      <font color="#FF0000">
      <select name="id_zu" size="1">
        <%
    do while rs_zu.eof=false
    %>
        <option value="<%=rs_zu("id")%>"><%=rs_zu("zu")%></option>
        <%
      rs_zu.movenext
    loop
    %>
      </select></font>
      </tr>


 <tr>
        <td align="right" height="30">项目稽核说明:</td>
        <td class="category">
          <textarea name="beizhu" cols="100" rows="2"></textarea>
        </td>
      </tr>      
      
      <tr>
        <td height="30"> </td>
        <td class="category">
          <input type="submit" value="确认项目稽核" onClick="return check1()" class="button">
          <input type="hidden" name="hid1" value="ok">
          <input type="reset" value="重新选择项目" class="button">
          </td>
      </tr>
      </form>
</table>
</td>
<td></td>
</tr>
<tr>
<td>
<img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td>
<img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
<iframe style="height:1px" src="" frameborder=0 width=1></iframe>
</body>
</html>
搜索更多相关主题的帖子: javascript language content 数据库 style 
2011-03-09 21:14
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
收藏
得分:0 
顶下自己,请教解决下哦,或者提示下也可以啊
2011-03-10 21:03
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:10 
是报的什么错误?给个提示

----我怎能在别人的苦难面前转过脸去----
2011-03-11 09:35
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
收藏
得分:0 
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
2011-03-15 22:38
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:10 
报的很清楚了,ID没有值,没法进行下一步的操作。。。。。。。

你看一下ID值是不是取错了

面朝大海,春暖花开!
2011-03-16 14:06
Iceya
Rank: 1
等 级:等待验证会员
帖 子:8
专家分:8
注 册:2011-2-15
收藏
得分:0 
参考传送错误
2011-03-21 11:07
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
收藏
得分:0 
回复5楼我知道ID没有值,这个值就是应该在红色代码部分运行后写进数据库的,现在的问题就是写不进去,我不知道为什么
2011-03-30 19:47
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:0 
没看到ID字段呢?ID字段是自动排号的么?

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2011-03-31 08:05
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
收藏
得分:0 
ID是数据库自动生成排列的
2011-04-01 06:36
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:0 
自行排列的就不要指定,指定就要赋值,赋值就不可能是自动排列

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2011-04-01 08:19
快速回复:请教高手,为何一段代码(红色部分)无法将值写进数据库"huiyuan" ...
数据加载中...
 
   



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

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