ASP提交表单是先进行Form填写检测,检测完成没问题之后再执行写入数据库表操作。
相关源码:
<% if request.Form<>"" then dim caseid,casename,company,addr,dep,contacts,phone,qs_inf,qs_wt,isdel,createtime,temp1,temp2 caseid=1 casename="调查表" company=trim(request.Form("company")) addr=trim(request.Form("addr")) dep=trim(request.Form("dep")) contacts=trim(request.Form("contacts")) phone=trim(request.Form("phone")) qs_inf=trim(request.Form("qs_inf")) if request.Form("a01")<>"" or request.Form("a02")<>"" then qs_wt="A. 提问"+trim(request.Form("a01"))+trim(request.Form("a02")) end if dim rs,sql set rs=server.CreateObject("adodb.recordset") sql="select * from colin" rs.open sql,objconn,1,2 rs.addnew() rs("caseid")=caseid rs("casename")=casename rs("company")=company rs("addr")=addr rs("dep")=dep rs("contacts")=contacts rs("phone")=phone rs("qs_inf")=qs_inf rs("qs_wt")=qs_wt rs("createtime")=now() rs.update() rs.close response.Write("") end if %>
-完-