将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 ...
随机推荐
- 总结Ajax的一些细节
Ajax的总结 主要从Ajax是什么?可以用来干什么?基本要素,优缺点,执行过程,跨域的解决方案等几方面来解释. Ajax是什么? Ajax主要用来实现客户端与服务器端的异步通信效果,实现页面的局部刷 ...
- C语言基础 (1) 操作系统介绍,linux入门
第一天 一.操作系统 1.1.1操作系统的目标 ·方便:使计算机系统易于使用 ·有效:以更有效的方式使用计算机系统资源 ·扩展:方便用户有效开发.测试和引进新功能 1.1.2 操作系统的地位 操作系统 ...
- js去掉字符串得第一个字符 、去掉字符串的最后一个字符
a1 = aa[0].slice(1); //去掉第一个字符串 a2 = a2.substr(0, a2.length - 1);
- 通过nodeSelector配置项实现pod部署至指定node
Node节点添加标签 [root@node1 work]# kubectl label nodes node1 node=master --overwrite node/node1 labeled [ ...
- 重载和const形参
1.int lookup(string p); 2.int lookup(const string p);//同1 3.int lookup(string *);//传入一个指针,指针指向string ...
- 大O时间复杂度
大O表示法指出了在最糟情况下的运行时间.比较操作数,指出了算法运行时间的增速 常见的大O运行时间 O(logn):也叫对数时间,包括二分查找 O(n):也叫线性时间,包括简单查找 O(nlogn):包 ...
- Unity 制作安装程序和卸载程序
1.最简单的方式通过winrar制作 但是做出来的页面好low的感觉 参考链接:https://www.cnblogs.com/fetty/p/5185913.html 2.通过inno制作安装程序: ...
- Java基础学习总结(2)——接口
一.接口的概念 JAVA是只支持单继承的,但现实之中存在多重继承这种现象,如"金丝猴是一种动物",金丝猴从动物这个类继承,同时"金丝猴是一种值钱的东西",金丝猴 ...
- ZOJ 1825 Compound Words
Compound Words Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Original ...
- 国庆 day 7 下午
思路:见博客. #include<iostream> #include<cstdio> #include<cstring> #include<algorith ...