判断ip是否重复
实现功能:数据库里有ip地址的字段,用户在访问这个页面的时候判断是否曾经提交过数据,我写了段代码,老是提示错误,高手帮我看看,多谢
<%
dim conn
dim connstr
dim rs
dim sql
connstr= "DBQ= "+server.mappath( "db/db.mdb ")+ ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}; "
set conn=server.createobject( "ADODB.CONNECTION ")
set rs=server.createobject( "ADODB.RECORDSET ")
conn.open connstr
sql= "select * from admin_info where ip-address= "&request.ServerVariables( "remote_addr ")
rs.open sql,conn,3,2
if not rs.eof and not rs.bof then
response.write " <script> alert( '已经访问过! '); </Script> "
end if
%>
------解决方案--------------------[IP-Address]???