asp怎么判断access数据库的值是否重复

2024-11-25 14:33:18
推荐回答(2个)
回答1:

<%
nowMAC=xx1-xx1-xx1
set rs=conn.execute("select * from MAC where MAC='"&nowMAC&"'")
if not rs.eof and not rs.bof then
response.write("OK")
else
response.write("NOT")
end if
%>

回答2:

sql="select * from MAC where MAC='xx1-xx1-xx1'"
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
response.write("OK")
else
response.write("NOT")
end if
rs.close
set rs=nothing