将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里的程序的更多相关文章

  1. SQL防注入程序 v1.0

    /// ***************C#版SQL防注入程序 v1.0************ /// *使用方法: /// 一.整站防注入(推荐) /// 在Global.asax.cs中查找App ...

  2. 启动phpstyle Apache的80端口被win7的System PID=4的进程占用的解决方法 以及 如何在phpStyle里发布程序

    学习前端是,用到Ajax,php语言,操作mysql数据库,浏览器无法解析php代码(把源码输出):原因,我之前用的是tomcat服务器写jsp,servlet,php用的是apache服务器,没有配 ...

  3. 浅谈数据库优化方案--表和SQL

    1.数据类型的选择 1.字段最好设置为非空.若字段为char(8),即便是NULL也会现有8个字符的空间. 2.尽量使用数字型字段,若只含数值信息的字段尽量不要设计为字符型,这会降低查询和连接的性能, ...

  4. 关于SQL Server 安装程序在运行 Windows Installer 文件时遇到错误

    前几日安装sql server2008r2 的时候碰到这个问题: 出现以下错误: SQL Server 安装程序在运行 Windows Installer 文件时遇到错误. Windows Insta ...

  5. php通用安装程序,导入数据文件(.sql)的安装程序

    php通用安装程序,导入数据文件(.sql)的安装程序 该程序只需要1个php文件 和 1个数据文件,很方便调用.install/index.php         程序文件install/mycms ...

  6. sql server安装程序无法验证服务账户是什么原因

    为了帮助网友解决“sql server安装程序无法验证服务”相关的问题,中国学网通过互联网对“sql server安装程序无法验证服务”相关的解决方案进行了整理,用户详细问题包括:能是尚未向所有要安装 ...

  7. 输//ip提示找不到应用程序

    输//ip提示找不到应用程序??? (未测试)试试:环境变量的 PATH 中添加 C:\Windows\system32 (未测试)试试:默认程序里----协议关联里:管理ie

  8. 多表查询sql语句

    多表查询sql语句 1 --解锁SCOTT用户 2 alter user scott account unlock 3 --检索指定的列 4 select job,ename,empno from e ...

  9. 图解 SQL 里的各种 JOIN

    约定 下文将使用两个数据库表 Table_A 和 Table_B 来进行示例讲解,其结构与数据分别如下: mysql> SELECT * FROM Table_A ORDER BY PK ASC ...

随机推荐

  1. c 和 指针读书笔记(1)

    1.字符串常量:出现在表达式中,其值是一个指针 "abc" + 1; //b 2.回掉函数:就是把函数的作为参数传入父函数,函数本身就是一个地址,传址肯定没问题.至于父函数是想用函 ...

  2. Centos6.6 yum源更新

    1备份: cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d//CentOS-Base.repo.ori 2下载: wget -O /etc/y ...

  3. Thunderbird导出邮件为PDF文件

    一般如果在windows下,可以通过打印的方式,生成一个PDF文件,可以完成此任务. 而今天在linux下采取此方式,生成的PDF文件居然是空白.原因未知. 而Thunderbird并未提供该功能,这 ...

  4. EularProject 42:单词解码出来的三角形数

    Coded triangle numbers Problem 42 The nth term of the sequence of triangle numbers is given by, tn = ...

  5. [MST] Build Forms with React to Edit mobx-state-tree Models

    We will expand our UI, and give the user the possibility to edit his wishlist. We will use the earli ...

  6. leetcode笔记:Merge Sorted Array

    一.题目描写叙述 二.解题技巧 这道题不存在复杂的分析过程和边界条件.假设单纯得考虑从小到大地将两个数组进行合并的话.每次在num1中插入一个数的话,须要将后面的元素都向后移动一位.这样.整个处理过程 ...

  7. 怎么样才算是精通 C++?

    C++是一门非常奇妙的语言.让人又爱又恨. 在知乎上看到的一个帖子.怎么样才算是精通C++,这里节选一些精彩的回复. 链接:http://www.zhihu.com/question/20201972 ...

  8. Hibernate_9_Person和IdCard实例_一对一关系:基于主键

    1)建立Person类:(与8同样) 2)建立IdCard类:(与8同样) 3)建立持久化类:  1>保存方法(与8同样)  2>获取方法(与8同样)  3>删除方法(与8同样)   ...

  9. vim 插件之NERD tree

    NERD tree 这个插件可以用来快速浏览目录结构,打开文件 地址 http://www.vim.org/scripts/script.php?script_id=1658 https://gith ...

  10. OneNote

    OneNote导致生成OneNote Table Of Contents.onetoc2 https://answers.microsoft.com/en-us/msoffice/forum/all/ ...