'IP / Source Public Function Address (SIP) DIM ACONNSTR, ACONN, ADB DIM STR1, STR2, STR3, STR4 DIM NUM DIM Country, City Dim IRS, SQL IF ISNUMERIC (Left (SIP, 2)) Then IF SIP = "127.0 .0.1 "THEN SIP =" 192.168.0.1 "STR1 = Left (SIP, INSTR (SIP,") - 1) SIP = MID (SIP, INSTR (SIP, ") 1) STR2 = LEFT (SIP , INSTR (SIP, ") - 1) SIP = MID (SIP, INSTR (SIP,") 1) STR3 = LEFT (SIP, INSTR (SIP, ") - 1) STR4 = MID SIP, INSTR (SIP, ") 1) if ISNUMERIC (STR1) = 0 or isnumeric (str2) = 0 or isnumeric (str3) = 0 or isnumeric (str4) = 0 THEN ELSE NUM = CLNG (str1) * 16777216 CLNG (STR2) * 65536 ClNG (STR3) * 256 ClNG (STR4) -1 adb = "data / ipaddress.mdb" aconnstr = "proviker = microsoft.jet.oledb.4.0; data source =" & Server . Mappath (adb) set aconn = server.createObject ("adoDb.connection") Aconn.open aconnstr SQL = "SELECT TOP 1 Country, City from DV_Address Where IP1 <=" & Num & "And IP2> =" & Num & "" SET IRS = Aconn.execute (SQL) if Irs.eof and Irs.bof the country = "Asia" City = "" Else Country = IRS (0) City = IRS (1) end i F set Irs = nothing set aconn = Nothing SQLQUERYNUM = SQLQUERYNUM 1 end if address = country & city else address = "Unknown" end if end function