但是为什么不能有正确的结果呢
我把代码给各位贴出来
set tempRS=server.createobject("adodb.recordset")
if request("id")="" then
ssql="select * from basic_price where distin = '"&request("distin")&"' and custom = '"&request("customID")&"' and (num2 < "&request("num0")&" or num1 > "&request("num1")&" ) "
else
ssql="select * from basic_price where (num2 < "&request("num0")&" or num1 > "&request("num1")&" ) and (distin = '"&request("distin")&"' and custom = '"&request("customID")&"') and code <> '"&request("id")&"'"
End if
response.write ssql
TempRS.open ssql,dicCon,1
response.end
if not tempRS.eof then
While not tempRS.eof
%>
<script language=javascript>
alert("您添加的数据在数据库中已经存在!");
history.back();
</script>
<%
tempRS.movenext
Wend
else
if request("id")="" then
rs.open "basic_price",dicCon,1,3
rs.addnew
else
rs.open "select * from basic_price where code = "&request("id"),dicCon,1,3
end if
if trim(request("distin"))<>"" then rs("distin")=trim(request("distin"))
if trim(request("num0"))<>"" then rs("num1")=request("num0")
if trim(request("num1"))<>"" then rs("num2")=request("num1")
if trim(request("price"))<>"" then rs("price")=trim(request("price"))
if trim(request("customID"))<>"" then rs("custom")=trim(request("customID"))
rs.update
rs.close
'response.redirect "custom_distin.asp?id="&request("customID")
End if