欢迎光临
我们一直在努力

刚刚梦贴了IP表,这个是一个把它存入SQL里的程序

建站超值云服务器,限时71元/月

写得比较粗糙,还有一点错误,不过能达到效果,凑合着用了,是4266条,不知道对也不对

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

%>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 刚刚梦贴了IP表,这个是一个把它存入SQL里的程序
分享到: 更多 (0)

相关推荐

  • 暂无文章