Function ErrRecord(WrongIp)
set rs=server.createobject("adodb.recordset")
sql="select * from ErrUser where ErrIp='"&WrongIp&"'"
rs.open sql,conn,1,1
if rs.eof then
sqlup="update ErrUser Set ErrNum=ErrNum+1 where ErrIp='"&WrongIp&"'"
set rs=conn.execute(sqlup)
else
addsql="select * from ErrUser where (Errid is Null)"
rs.open addsql,conn,1,3
rs.addnew
rs("ErrIp")=WrongIp
rs("ErrNum")=0
rs.update
End if
ErrRecord=rs("ErrNum")
rs.close
End Function