Pure IP database rotation network database ASP script
Go to the innocent website to download the IP database. At the same time, the query program (Showip.exe) attached to the database has the function of detecting and upgrading the IP database online. As long as you run the program, click on the upper right corner.
"Online Upgrade" allows you to upgrade the IP database to the latest version without having to download the new version of the IP database from the download website.
At the same time, the query program (Showip.exe) also provides the function of decompressing it into .txt files:)
We will use this function to achieve a database that is converted to MDB format.
Step 1: Open the query program (Showip.exe) and click to unzip
Step 2: Save the exported data text as ipaddress.txt. After the prompt is successful, confirm to close.
Step 3: Create a new MDB file, name it ipaddress.mdb, click Open, use the function of importing text files provided by Access to import the ipaddress.txt just exported into the database.
Step 4: Import Text Wizard:
1. Select the [with separator - separate each field with symbols such as commas or tabs] option
2. Next step: select space as the separator;
3. Next step: in the new table;
4. Next step: The first field, no modification is made, and the next step is defaulted to;
5. Next step: Define the primary key: select Don’t primary key;
6. Next step: Default ipaddress table name, complete.
Step 5: Create a data table in dynamic network format ipaddress2
id numbering (can be not allowed)
ip1 double precision data
ip2 double precision data
country text 100 bytes
City text 255 bytes
Close the database.
Step 6: Run ip.ASP in ASP environment
Step 7: The database at this time is very large. In order to be smaller: (, create a new empty database and import ipadress2 from the original database. ^!^
I won't talk about future applications. ~~~
Important scripts:
The code copy is as follows:
<%
Server.ScriptTimeOut=999
min=0''Start count
max=260262'' end number data number-1
DimConn
SetConn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:DatabasePassword=01;DataSource="&Server.MapPath("ipaddress.mdb")
Conn.Open
IfErrThen
Err.Clear
SetConn=Nothing
Response.Write("<head><metahttp-equiv=""Content-Type""content=""text/html;charset=gb2312""/><title>The database connection error occurs, please check the connection string</title></head><body><divalign=""center""style=""width:400px;height:100px;padding:8px;font-size:9pt;border:1pxsolidThreeDShadow;POSITION:absolute;top:exp Response((document.body.offsetHeight-100)/2);left:expression((document.body.offsetWidth-400)/2);""><tablewidth=""100%""height=""100%""style=""font-size:12px;font-family:Tahoma;""><tr><tdalign=""center""><strong>The database connection error, please check the connection string</strong></td></tr></table></div></body>")