Right at the start you could do something like

<%
sIP=Request.ServerVariables("REMOTE_ADDR")
'Open the database connection
sSQL="SELECT * FROM tblName WHERE IP='" & sIP & "'"
'I used dBase as my connection
Set RS=dBase.execute(sSQL)
'do what ever from here
%>

<HTML>

<HEAD>
</HEAD>

<BODY>
<%=sIP%>
</BODY>
</HTML>

Hope this helps