Web Hosting Info

Search:

featured partner

The IP to Country Database

  Forum Topics : Wish List / ASP Code
Submitted by suryasg on Sat, 01/31/2004 - 19:26.
I want to provide tips on
1. How to create MS Access table from CSV file easily.
2. ASP code to read that table and display info.

Is it already there? If not, How can I contribute?
thanks,
Surya
Comment viewing options:
Select your preferred way to display the comments and click 'Save settings' to submit your changes.
Commands to use the tcl on eggdrop
Posted by dead2be on Wed, 02/11/2004 - 22:56.
how i can use the tcl on eggdrop i have uploaded the tcl and databse and rehashed the eggdrop and now dont know how to submit the commands
thanks
I need the asp code please, a
Posted by zMaestro on Wed, 07/13/2005 - 05:40.
i need the asp code please, any help?
 
Would like ASP code for IP-to-Country
Posted by rcotter on Wed, 07/13/2005 - 13:24.
Surya: I saw your posting on offering to supply ASP code for the IP-to-Country database lookup. If you ever did produce ASP or ASPX code, I would appreciate receiving it. I can be reached at richard.cotter@sympatico.ca

Thanks

Richard
Asp Code
Posted by dakris on Mon, 07/25/2005 - 01:03.
You can import csv file into Access database. Just click on new table button in Access and ...
I named the fields "From" (the lover number), "To" (The higer number) And "Country" (The counrty name).

So when i grab a IP number from user e.g.
UserIp = Request.ServerVariables("REMOTE_ADDR")
I now have a IP number from the user

So I made a function called Country
You can use it like that:

Response.Write Country(UserIp)

Function Country(IPNr)
   arrIp = Split(IPNr, ".")
   IPnumber = (arrIp(0) * 16777216) + (arrIp(1) * 65536) + (arrIp(2) * 256) + arrIp(3)
   Set rsCountry = cmd.ActiveConnection.Execute("Select * From [Ip-to-country] Where " & IPnumber & " >= From And " & IPnumber & " <= To;")
   If Not(rsCountry.EOF) Then
      Country = rsCountry("Country")'If number is in the database
   Else
      Country = IPnumber 'If number is not in the database then just write the IP number.
   End If
   Set rsCountry = Nothing
End Function
Asp Code
Posted by dakris on Mon, 07/25/2005 - 01:07.
You can import csv file into Access database. Just click on new table button in Access and ...
I named the fields "From" (the lower number), "To" (The higer number) And "Country" (The counrty name).

So when i grab a IP number from user e.g.
UserIp = Request.ServerVariables("REMOTE_ADDR")
I now have a IP number from the user

So I made a function called Country
You can use it like that:

Response.Write Country(UserIp)

Function Country(IPNr)
   arrIp = Split(IPNr, ".")
   IPnumber = (arrIp(0) * 16777216) + (arrIp(1) * 65536) + (arrIp(2) * 256) + arrIp(3)
   Set rsCountry = cmd.ActiveConnection.Execute("Select * From [Ip-to-country] Where " & IPnumber & " >= From And " & IPnumber & " <= To;")
   If Not(rsCountry.EOF) Then
      Country = rsCountry("Country")'If number is in the database
   Else
      Country = IPnumber 'If number is not in the database then just write the IP number.
   End If
   Set rsCountry = Nothing
End Function