日期:2014-05-17 浏览次数:21033 次
<% response.charset = "GBK" if session("Admin") = "" then call sussLoctionHref("非法登录","admin_login.asp") end if %> <!--#include file="../Include/function.asp"--> <!--#include file="../Data/conn.asp"--> <% '添加栏目 if request.form("send") = "添加栏目" then dim nav,rs,sql nav = request.form("nav") if len(nav) < 2 or len(nav) > 5 then call errorHistoryBack("栏目不得少于2位大于5位") end if '新增之前验证是否重复 set rs = server.createobject("adodb.recordset") sql = "select * from Nav where NavName='"&nav&"'" rs.open sql,conn,1,1 if not rs.eof then call errorHistoryBack("此栏目已存在,无须添加") call close_rs call close_conn end if call close_rs '关闭销毁表 '新增 sql = "insert into Nav (NavName,Date) values ('"&nav&"',now())" conn.execute(sql) call close_conn '关闭销毁数据库 call sussLoctionHref("栏目新增成功","admin_nav.asp") end if %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>菲戈--栏目添加</title> <link rel="stylesheet" type="text/css" href="css/login.css" /> </head> <body> <div class="nav_col">栏目添加</div> <div class="nav_show">栏目显示</div> <div class="path"><a href="admin_nav.asp"><font color='#FF0000'>返回栏目管理</font></a></div> <form id="form_nav_add" method="post" action="admin_nav_add.asp"> 栏目名称:<input type="text" name="nav" class="text" /> <input type="submit" name="send" value="添加栏目" class="submit" /> </form> </body> </html>
'sql = "insert into Nav (NavName,Date) values ('"&nav&"',now())" sql = "insert into Nav (NavName,[Date]) values ('"&nav&"',now())"
------解决方案--------------------
建议如下
sql = "insert into Nav (NavName,[Date]) values ('"&nav&"','"&now()&"')&q