将IP表存入SQL里的程序
将IP表存入SQL里的程序
写得比較粗糙,另一点错误,只是能达到效果。请大家測试
create.asp
-----------------------------------------------------------------------
<%
'Option Explicit
Server.Scripttimeout = 1000
On Error Resume Next
' Define your sql info here
strSQLDSN = "xxxx"
strSQLUsername = "sa"
strSQLPassword = ""
' This is where we connect to our sql server
Set adoConn = Server.CreateObject("ADODB.Connection")
ConnectionString = "dsn=" & strSQLDSN & ";uid=" & strSQLUsername & ";pwd=" & strSQLPassword & ""
adoConn.Open ConnectionString
'Set adoRS = Server.CreateObject("ADODB.Recordset")
' get sql from ip.txt
Set fso = Server.Createobject("Scripting.FilesystemObject")
If fso.Fileexists(Server.Mappath("ip.txt")) then
Set a = fso.OpenTextFile(Server.Mappath("ip.txt"), 1, False)
Do While a.AtEndOfStream <> True
sql = a.readline
adoConn.Execute (sql)
Loop
a.close
set a = nothing
Else
Response.Write "文件没找到"
Response.End
End if
Set fso = Nothing
'Error Handle
If err.number <> 0 then
' this code come from http://bigeagle.wotoo.com
strMsg = strMsg + "********************************************" + vbcrlf
strMsg = strMsg + "错误时间:" + CStr(Now()) + vbcrlf
strMsg = strMsg + "错误类型:Err错误" + vbcrlf
strMsg = strMsg + "错误号 :" + CStr(Err.Number) + vbcrlf
strMsg = strMsg + "错误源 :" + Err.Source + vbcrlf
strMsg = strMsg + "错误描写叙述:" + Err.Description + vbcrlf
strMsg = strMsg + "*********************************************" + vbcrlf
strLogMsg = strLogMsg + "*****************************************" + vbcrlf
strLogMsg = strLogMsg + "错误时间:" + CStr(Now()) + vbcrlf
strLogMsg = strLogMsg + "错误类型:Err错误" + vbcrlf
strLogMsg = strLogMsg + "错误号 :" + CStr(Err.Number) + vbcrlf
strLogMsg = strLogMsg + "错误源 :" + Err.Source + vbcrlf
strLogMsg = strLogMsg + "错误描写叙述:" + Err.Description + vbcrlf
strMsg = strMsg + "********************************************" + vbcrlf
Response.Write strMsg
End If
%>
将IP表存入SQL里的程序的更多相关文章
- SQL防注入程序 v1.0
/// ***************C#版SQL防注入程序 v1.0************ /// *使用方法: /// 一.整站防注入(推荐) /// 在Global.asax.cs中查找App ...
- 启动phpstyle Apache的80端口被win7的System PID=4的进程占用的解决方法 以及 如何在phpStyle里发布程序
学习前端是,用到Ajax,php语言,操作mysql数据库,浏览器无法解析php代码(把源码输出):原因,我之前用的是tomcat服务器写jsp,servlet,php用的是apache服务器,没有配 ...
- 浅谈数据库优化方案--表和SQL
1.数据类型的选择 1.字段最好设置为非空.若字段为char(8),即便是NULL也会现有8个字符的空间. 2.尽量使用数字型字段,若只含数值信息的字段尽量不要设计为字符型,这会降低查询和连接的性能, ...
- 关于SQL Server 安装程序在运行 Windows Installer 文件时遇到错误
前几日安装sql server2008r2 的时候碰到这个问题: 出现以下错误: SQL Server 安装程序在运行 Windows Installer 文件时遇到错误. Windows Insta ...
- php通用安装程序,导入数据文件(.sql)的安装程序
php通用安装程序,导入数据文件(.sql)的安装程序 该程序只需要1个php文件 和 1个数据文件,很方便调用.install/index.php 程序文件install/mycms ...
- sql server安装程序无法验证服务账户是什么原因
为了帮助网友解决“sql server安装程序无法验证服务”相关的问题,中国学网通过互联网对“sql server安装程序无法验证服务”相关的解决方案进行了整理,用户详细问题包括:能是尚未向所有要安装 ...
- 输//ip提示找不到应用程序
输//ip提示找不到应用程序??? (未测试)试试:环境变量的 PATH 中添加 C:\Windows\system32 (未测试)试试:默认程序里----协议关联里:管理ie
- 多表查询sql语句
多表查询sql语句 1 --解锁SCOTT用户 2 alter user scott account unlock 3 --检索指定的列 4 select job,ename,empno from e ...
- 图解 SQL 里的各种 JOIN
约定 下文将使用两个数据库表 Table_A 和 Table_B 来进行示例讲解,其结构与数据分别如下: mysql> SELECT * FROM Table_A ORDER BY PK ASC ...
随机推荐
- 路飞学城Python-Day4(practise)
#1.请用代码实现:利用下划线将列表的每一个元素拼接成字符串,li = ['alex','eric','rain']# li = ['alex','eric','rain']# print('_'.j ...
- jquery复制到剪贴板
<!DOCTYPE html> <html> <head> <title>ZeroClipboard Test</title> <me ...
- php7 memcache和memcached.so扩展
php7安装memcache和memcached扩展 https://github.com/websupport-sk/pecl-memcache https://github.com/php-mem ...
- python_模块学习
'''import sysprint(sys.path) #打印环境变量 #运行结果为:['D:\\PyCharm Community Edition 2018.2.2\\NewYear\\untit ...
- 紫书 习题8-10 UVa 1614 (贪心+结论)
这道题我苦思冥想了一个小时, 想用背包来揍sum/2, 然后发现数据太大, 空间存不下. 然后我最后还是去看了别人的博客, 发现竟然有个神奇的结论-- 幸好我没再钻研, 感觉这个结论我肯定是想不到的- ...
- Python学习第二天-编写购物车
需求:1.启动程序后,让用户输入工资,然后打印商品列表 2.允许用户根据商品编号购买商品 3.用户选择商品后,检测余额是否够,够就直接扣款,不够就提醒 ...
- 12、NIO、AIO、BIO二
一.NIO2快速读写文件 写完之后记得flush一下,NIO2不能自行创建文件,需要在文件中判断一下. package com.zxc.L; import org.junit.Test; import ...
- 从头认识Spring-1.16 SpEl对集合的操作(1)-建立集合以及訪问集合的元素,以<util:list/>为例
这一章节我们来讨论一下怎样建立集合以及訪问集合的元素? 1.建立集合? (1)domain 蛋糕类: package com.raylee.my_new_spring.my_new_spring.ch ...
- STL源代码学习(vector篇)
#include <concept_checks.h> #include<stl_allocate.h> /// The vector base class's constru ...
- JSONObject与JSONArray的使用区别
1.JSON 1. 创建一个JSONObject对象: package com.yunos.tv.video.resource.controller.web; import java.util.Arr ...