时间:2021-07-01 10:21:17 帮助过:69人阅读
<!--#include file="conn.asp" --> <% whattitle=request.form("title") whoauthor=request.form("author") whatcontent=request.form("content") %> <% Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from cnarticle" rs.Open sql,conn,3,2 %> <% rs.addnew rs("cn_title")=whattitle rs("cn_author")=whoauthor rs("cn_content")=whatcontent rs.update %> 文章添加成功,<a href="showit.asp">浏览</a> <% rs.close Set rs = Nothing conn.close set conn=Nothing %> |
<!--#include file="conn.asp" --> <% whattitle=trim(request.form("title")) whoauthor=trim(request.form("author")) whatcontent=trim(request.form("content")) %> <%if whattitle="" then%> <script language=vbs> alert("请输入文章标题") history.go(-1) </script> <%end if%> <%if whatcontent="" then%> <script language=vbs> alert("请输入文章标题") history.go(-1) </script> <%end if%> <% Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from cnarticle" rs.Open sql,conn,3,2 %> <% rs.addnew rs("cn_title")=whattitle rs("cn_author")=whoauthor rs("cn_content")=whatcontent rs.update %> 文章添加成功,<a href="showit.asp">浏览</a> <% rs.close Set rs = Nothing conn.close set conn=Nothing %> |
<%if whattitle="" then%> <script language=vbs> alert("请输入文章标题") history.go(-1) </script> <%end if%> |
rs.addnew rs("cn_title")=whattitle ... rs.update |
<!--#include file="conn.asp" --> <% whattitle=request.form("title") whoauthor=request.form("author") whatcontent=request.form("content") %> <% sql = "insert into cnarticle(cn_title,cn_author,cn_content) values(' "&whattitle&" ',' "&whoauthor&" ',' "&whatcontent&" ')" conn.Execute(sql) %> 文章添加成功,<a href="showit.asp">浏览</a> <% conn.close set conn=Nothing %> |
Microsoft JET Database Engine 错误 '80040e21' 字段 'xxx.xxx' 不能是零长度的字符串。 |