有关跳转之后出现的问题~!

stevenpho 2007-10-28 10:54:24
我从edit.jsp提交到edit.jsp老是出现:Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 '12where check_no='12'' 中 这个问题,哎半天没弄来,帮忙解决哈
edit.jsp
<%@ page contentType="text/html; charset=gb2312"%>
<%@ include file="conn.jsp"%>
<html>
<head><title>
考勤信息
</title></head>
<body>

<%
rs=null;
try{
int s =Integer.parseInt(request.getParameter("bh"));
sql = "SELECT * FROM work_check_categories WHERE check_no ="+s;
rs=smt.executeQuery(sql);
%><form name ="form" action="editsuc.jsp?bh=<%=s%>" method="post" align="center">
<table>
<%
while(rs.next()) {
%>
<tr>
<td>编  号</td>
<td><%=rs.getObject(1)%></td>
</tr>
<tr>
<td>考勤类别</td>
<td><input type ="text" name="name" value="<%=rs.getObject(2)%>"></td>
</tr>
<tr>
<td>罚  金</td>
<td>  <input type="text" name= "name1" value="<%=rs.getObject(3)%>"></td>
</tr>
<tr>
<td><input type = "submit" value = "修改"></td>
<td><input type = "reset" value = "恢复"></td>
</tr>
</table>
</form>
<%}
} catch(Exception e) {
e.getMessage();
}
%>
</body>
</html>




editsuc.jsp
<%@ page contentType="text/html; charset=gb2312"%>
<%@ include file = "conn.jsp"%>
<html>
<head><title>
考勤信息
</title></head>
<body>
<%! int check_fine;
String b, check_name;%>
<% b= request.getParameter("bh");
check_name = request.getParameter("name");
check_fine = Integer.parseInt(request.getParameter("name1"));
%>
<%
try{
sql = "update work_check_categories set check_name ='"+check_name+"',check_fine="+check_fine+"where check_no='"+b+"'";
smt.executeUpdate(sql);%>
out.println("<font size= "5">正在修改记录</font>")
<%
}catch(Exception e) {
out.println(e.getMessage());
}
//response.sendRedirect("index.jsp");
%>
</body>
</html>
...全文
44 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,657

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧