| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1056 人关注过本帖
标题:请各位ASP高手帮忙改错!
取消只看楼主 加入收藏
jsy110
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-2-25
结帖率:50%
收藏
 问题点数:0 回复次数:2 
请各位ASP高手帮忙改错!
News_edit_main.asp 部分代码:
… …
<table width="743" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="743" height="34" valign="top" class="STYLE2">
    <%=session("name") %>发表过的文章    </td>
  </tr>
  <tr>
    <td height="30" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#0066FF">
      <%
         Dim zzhe
         if session("name")="" then
             Response.Write "<Script>alert('对不起,您还没有登录!');history.go(-1);</Script>"
             Response.End
          else
          zzhe=session("name")                    
      End if
        set rs1= Server.CreateObject("adodb.recordset")
            sql1= "select * from [user] where name= '" & zzhe & "'"
            rs1.open sql1,conn,3,3
                
         set rs2= Server.CreateObject("ADODB.Recordset")
         if rs1("flag")<3 then
         sql2="select * from [news]  where editor = '"& zzhe &"' order by time desc "
          else
          sql2="select * from [news] order by time desc "
         End if
          rs2.open sql2,conn,3,3
       if rs2.Bof or rs2.Eof then
        Response.Write "<Script>alert('对不起,目前还没有您发表的文章!');history.go(-1);</Script>"
        Response.End
          End if
          Do while not rs2.Eof
           
          %>
      <tr>
      
        <td width="743" height="30" valign="top" bgcolor="#FFFFFF" class="t2">
        类型:<%= rs2("class") %>&nbsp;&nbsp;&nbsp;&nbsp;标题:<%= rs2("title") %>&nbsp;&nbsp;&nbsp;&nbsp;发表时间:<%= rs2("time") %>&nbsp;&nbsp;&nbsp;&nbsp;<a href="News_edit.asp?id=<%= rs2("id") %>">修改</a></td>
        </tr>
          <%
      rs2.movenext
      Loop
       %>
        <%
      rs2.close
      set rs2=nothing
      rs1.close
      set rs1=nothing
       %>
    </table></td>
  </tr>
  <tr>
    <td height="17">&nbsp;</td>
  </tr>
</table>

 … …

News_edit.asp 部分代码:
… …
<table width="743" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF">
  <!--DWLayoutTable-->
  <tr>
    <td width="741" height="32" align="center" valign="middle" bgcolor="#FFFFFF"><span class="STYLE1">信息修改</span></td>
  </tr>
  <%
  dim xuhao
  xuhao=Trim(Request.QueryString("id"))
  set rs= Server.CreateObject("adodb.recordset")
      sql= "select * from [news] where id=" & xuhao
      rs.open sql,conn,3,3

        %>
  
  <form name="form2" method="post"  action="News_edit.asp?action=newsedit" >
  <tr>
    <td height="32" valign="top" bgcolor="#FFFFFF" class="t2">文章类别:
    <input name="wzlb" type="radio" value="xw" checked="checked" />
    新闻 &nbsp;&nbsp;
    <input type="radio" name="wzlb" value="kx" />
    快迅&nbsp;&nbsp;
    <input type="radio" name="wzlb" value="tz" />   
    通知&nbsp;&nbsp;
    <input name="wzlb" type="radio" value="tg" />
    通告&nbsp;&nbsp;
    <input type="radio" name="wzlb" value="tb" />
    通报&nbsp;&nbsp;
    <input type="radio" name="wzlb" value="gb" />
    公报&nbsp;&nbsp;
    <input type="radio" name="wzlb" value="gs" />
    公示</td>
  </tr>
  <tr>
    <td height="32" valign="top" bgcolor="#FFFFFF" class="t2">状态:
    <input name="state" type="radio" value="pt" checked="checked" />
    普通
    <input type="radio" name="state" value="zy" />
    重要
    <input type="radio" name="state" value="jj" />
    紧急</td>
  </tr>
  <tr>
    <td height="32" valign="top" bgcolor="#FFFFFF" class="t2">作者:
    <input name="author" type="text" id="author" value="<%= rs("author") %>" /></td>
  </tr>
  <tr>
    <td height="32" valign="top" bgcolor="#FFFFFF" class="t2">标题:
    <input name="title" type="text" id="title" value="<%= rs("title") %>" /></td>
  </tr>
  <tr>
    <td height="32" valign="top" bgcolor="#FFFFFF" class="t2">发布图片:
    <input name="imagepath" type="file" id="imagepath"  /></td>
  </tr>
  <tr>
    <td height="32" valign="top" bgcolor="#FFFFFF" class="t3">正文</td>
  </tr>
  <tr>
    <td height="551" align="center" valign="top" bgcolor="#FFFFFF"><textarea name="content" cols="110" rows="35" class="t4" id="content"><%= rs("content") %></textarea></td>
  </tr>
  <%
  rs.close
  set rs=nothing
   %>
  <tr>
    <td height="31" valign="top" bgcolor="#FFFFFF" class="t3">
    <input type="submit" name="Submit2" value="提交" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="reset" name="Submit3" value="重置" /></td>
  </tr>
  </form>
  <tr>
    <td height="33">&nbsp;</td>
  </tr>
</table>
<%
  if Trim(Request.QueryString("action")) = "newsedit" then
     call newsedit()
  end if

 %>
 
 <%
    Sub newsedit()
        dim wzlb
        dim state
        dim author
        dim title
        dim imagepath
        dim content
        wzlb=Trim(Request.Form("wzlb"))
        state=Trim(Request.Form("state"))
        author=Trim(Request.Form("author"))
        title=Trim(Request.Form("title"))
        imagepath=Trim(Request.Form("imagepath"))
        content=Trim(Request.Form("content"))
        set rs= Server.CreateObject("ADODB.Recordset")
           sql="select * from [news] where id= " & xuhao
           rs.open sql,conn,3,3

        select case wzlb
           case "xw"
           rs("class")="新闻"
           case "kx"
           rs("class")="快迅"
           case "tz"
           rs("class")="通知"
           case "tg"
           rs("class")="通告"
           case "tb"
           rs("class")="通报"
           case "gb"
           rs("class")="公报"
           case "gs"
           rs("class")="公示"
           
        end select
        
        select case state
           case "pt"
           rs("state")= "普通"
           case "zy"
           rs("state")= "重要"
           case "jj"
           rs("state")= "紧急"
        end select
           if author="" then
                Response.Write "<Script>alert('请输入作者名!')</Script>"
                 Response.End
              else
               rs("author")= author
           end if
            if title="" then
                Response.Write "<Script>alert('请输入文章标题!')</Script>"
                 Response.End
              else             
                rs("title") = title
            end if
            if imagepath <> "" then
                rs("image") = GetFileName(imagepath)
            end if
            if content = "" then
                 Response.Write "<Script>alert('文章内容不能为空!')</Script>"
                  Response.End
             else
                rs("content")= content
           end if
               rs("time")= Now()
               rs("editor")=session("name")
               rs.update
               rs.close
               set rs=nothing
               if imagepath <> "" then
                  upImages(imagepath)
               end if  
           Response.Redirect "index.asp"
           
        
        
        
    End Sub
 
  %>
… …
News_edit.asp页执行的时候报错,错误信息为:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
/News_edit.asp, 第 369 行,
我把可疑的相关代码已经标红,请各位大虾帮忙看看,到底错在哪里?不胜感激。。。
搜索更多相关主题的帖子: ASP 改错 name 
2008-03-03 15:13
jsy110
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-2-25
收藏
得分:0 
请高手们继续找错。。
SQL语句没有错,请各位高手继续帮忙找错误。。
2008-03-03 16:08
jsy110
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-2-25
收藏
得分:0 
郁闷中
相当郁闷,问题还是没有解决。。。[bc02]
2008-03-04 08:43
快速回复:请各位ASP高手帮忙改错!
数据加载中...
 
   



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

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