求救 判断提交的是否有同名

来源:百度知道 编辑:UC知道 时间:2024/06/01 07:45:49
<%

'添加开始
if request.form("action")="AddCompany" and request.form("Company_cn")

<>"" and request.form("Area1")<>"" and request.form("Principal_cn")<>""

and request.form("Company_LinkTime")<>"" and request.form

("Company_Address1")<>"" and request.form("Tel")<>"" and

request.form("Content")<>"" then

'--------------------------------------------------------

set rs=server.createobject("adodb.recordset")
sql="select * from SK_Company where id is null "
rs.open sql,conn,1,3

rs.AddNew
'--------------------------------------------------------

rs("SK_Area1")=R

改成:
<%
'添加开始
if request.form("action")="AddCompany" and request.form("Company_cn")<>"" and request.form("Area1")<>"" and request.form("Principal_cn")<>"" and request.form("Company_LinkTime")<>"" and request.form("Company_Address1")<>"" and request.form("Tel")<>"" and request.form("Content")<>"" then
'--------------------------------------------------------
set rs=server.createobject("adodb.recordset")
sql="select * from SK_Company"
rs.open sql,conn,1,3
do while not rs.eof
if rs("SK_Company_cn")=Request.Form("Company_cn") then
Response.Write"<script>alert('用户名重复!');location.go(-1);</SCRIPT>"
response.End()
end if