将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. python 中进制转换及format(),int()函数用法

    python中数值型变量好像只能是十进制形式表示,其他类型变量只能以字符串形式存在,可以通过format函数将int类型变量转换成其他进制字符串,如下所示: v_code=15 # 2进制 x=for ...

  2. Java 8 Stream API具体解释

    Java 8 Stream API具体解释 一.Stream API介绍 Java 8引入了全新的Stream API,此Stream与Java I/O包里的InputStream和OutputStr ...

  3. 三角函数之美-水波纹载入LoadingView

    一.前言 学习是要总结的.近期几天学习了画图相关的,可是使用的机会较少,如今又快要遗忘了,这次看了水波纹的绘制.认为十分有意思,还是 把实现的方法记录下来.技术无他,为手熟尔.还是要多练习,空淡误国, ...

  4. 【剑指Offer面试题】 九度OJ1371:最小的K个数

    题目链接地址: http://ac.jobdu.com/problem.php?pid=1371 题目1371:最小的K个数 时间限制:1 秒内存限制:32 兆特殊判题:否提交:5938解决:1265 ...

  5. C++基础之全局变量

    C++的水比較深,之前我一直以为C++的全局变量会像其它语言一样,很easy仅仅要在头文件里,定义一个变量就可以,比方以下的test.h: #ifndef _TEST_H #define _TEST_ ...

  6. vim 插件之vim-trailing-whitespace

    vim-trailing-whitespace 这个插件是快速去掉文章行末的空格 地址 http://github.com/bronson/vim-trailing-whitespace 如果你想要使 ...

  7. 智课雅思短语---五、 in contrast / on the contrary

    智课雅思短语---五. in contrast / on the contrary 一.总结 一句话总结:相反 in contrast / on the contrary. 1.replace/ su ...

  8. storm集群安装配置

    1.上传解压 2.进入到storm的conf目录 接上图 启动三台节点的zookeeper集群 启动和查看 Storm 在 nimbus.host 所属的机器上启动 nimbus 服务和 logvi ...

  9. P2264 情书(字符串hash90分)

    题目背景 一封好的情书需要撰写人全身心的投入.lin_toto同学看上了可爱的卡速米想对她表白,但却不知道自己写的情书是否能感动她,现在他带着情书请你来帮助他. 题目描述 为了帮助lin_toto,我 ...

  10. webpack入门与笔记

    为什要使用WebPack 现今的很多网页其实可以看做是功能丰富的应用,它们拥有着复杂的JavaScript代码和一大堆依赖包.为了简化开发的复杂度,前端社区涌现出了很多好的实践方法 模块化,让我们可以 ...