r own values.
 , Set conn = Server.CreateObject("ADODB.Connection")
 ,
 , myDSN = "DRIVER={SQL Server},SERVER=servername,UID=username,PWD=password,DATABASE=IP2Location"
 ,
 , conn.open myDNS
 ,
 , ' retrieve visitor IP address and translate it to IP address number
 , IPno = Dot2LongIP(Request.ServerVariables("REMOTE_ADDR"))
 ,
 , ' SQL query to
lookup valid range of IP address
 , mySQL = "SELECT countrySHORT FROM IPCountry WHERE " & IPno & " BETWEEN ipFROM AND ipTO"
 ,
 , Set rs = Server.CreateObject("ADODB.Recordset")
 , rs.open mySQL, conn
 ,
 , ' assign country name for reference
 , countryName = rs("countrySHORT")
 ,
 , ' close and free connections
 , rs.close
 , conn.close
 , set rs = nothing
 , Set conn = nothing
 ,
 , If CountryName = "JP" Then
 , ' Visitor is from Japan
 , ' Redirect the URL to Google Japanese site
 , Response.Redirect
google.co.jp"
 , Else
 , ' Visitor is not from Japan
 , ' Redirect the URL to Google international site
 , Response.Redirect
google.com"
 , End If
 ,
 , Function Dot2LongIP (ByVal DottedIP)
 , , Dim i, pos
 , , Dim PrevPos, num
 , , If DottedIP = "" Then
 , , Dot2LongIP = 0
 , , Else
 , , For i = 1 To 4
 , , pos = InStr(PrevPos + 1, DottedIP, ".",
1)
 , , If i = 4 Then
 , , pos = Len(DottedIP) + 1
 , , End If
 , , num = Int(Mid(DottedIP, PrevPos + 1, pos - PrevPos -
1))
 , , PrevPos = pos
 , , Dot2LongIP = ((num Mod 25
6) = (256 ^ (4 - i))) + Dot2LongIP
 , , Next
 , , End If
 , End Function
%>,
Place this script as the default script of the web site. All visitors will go through this screening before redirect to an appropriate web page. "