conn.asp
上传用户:led20009
上传日期:2021-02-03
资源大小:517k
文件大小:6k
源码类别:

压缩解压

开发平台:

ASP/ASPX

  1. <%
  2. '程序:王星亮 网名:血饮狂刀 国外的叫我LANBOO
  3. 'OICQ:40001
  4. 'EMAIL:webmaster@xytime.com
  5. '我是什么都有,您想要我开发什么程序,尽管说。只要价格合理就行。
  6. '我电话:13308715776 0871-3394913
  7.  UrlName=request.servervariables("SCRIPT_NAME")
  8.  dim conn,LoginName,OperId
  9.  '开始数据库连接
  10.  connstr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("data.mdb")
  11. ' connstr="DSN=kmtv"
  12. '  set conn=server.createobject("ADODB.CONNECTION")
  13.  '   conn.Open  "Provider=SQLOLEDB.1;Password=ppopp;Persist Security Info=True;User ID=netoapp;Initial Catalog=superoa;Data Source=(local);Connect Timeout=15"
  14.  set conn=server.createobject("ADODB.CONNECTION")
  15.  conn.open connstr 
  16.   sub Back(mesg)
  17.     %><script language='javascript'>alert('<%=mesg%>');setTimeout('history.go(-1)',1);</script><%
  18.     response.end
  19.   end sub
  20.   function html(str)
  21.     on error resume next
  22.     dim result
  23.     dim l
  24.     if isnull(str) then
  25.        html=""
  26.        exit function
  27.     end if
  28.     l=len(str)
  29.     result=""
  30. dim i
  31. for i = 1 to l
  32.     select case mid(str,i,1)
  33. '       case chr(34)
  34. '         result=result+"&quot;"
  35. '       case "&"
  36. '         result=result+"&amp;"
  37. '       case "<"
  38. '         result=result+"&lt;"
  39. '       case ">"
  40. '         result=result+"&gt;"         
  41.       case "'"
  42.         result=result+"''"
  43. '       case chr(13)
  44.         result=result+"<br>"
  45. '       case chr(9)
  46. '         result=result+"&nbsp;&nbsp;&nbsp;&nbsp;"
  47. '       case chr(32)            
  48. '         if i+1<=l and i-1>0 then
  49. '           if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9)  then                       
  50. '             result=result+"&nbsp;"
  51. '           else
  52. '             result=result+" "
  53. '           end if
  54. '         else
  55. '           result=result+"&nbsp;"                     
  56. '         end if
  57.       case else
  58.         result=result+mid(str,i,1)
  59.         end select
  60.        next 
  61.        if err.number<>0 then err.clear
  62.        html=result
  63.    end function
  64.    function UnHtml(strInput)
  65.      dim sstrResult
  66.      sstrResult = strInput
  67.      sstrResult = Replace(sstrResult,"<br>",chr(13))
  68.      sstrResult = Replace(sstrResult,"&nbsp;"," ")
  69.      sstrResult = Replace(sstrResult,"''","'")
  70.      sstrResult = Replace(sstrResult,"&quot;",chr(34))
  71.      sstrResult = Replace(sstrResult,"&amp;","&")
  72.      UnHtml = sstrResult
  73.     end function  
  74. sub Mesg(tmp,tmpkind,aa)
  75. %>
  76. <form method="post" action="">
  77. <table border="1" bordercolorlight="000000" bordercolordark="FFFFFF" cellspacing="0" bgcolor="#C0C0C0" align=center>
  78. <tr>
  79. <td>
  80. <table border="0" bgcolor="#0099FF" cellspacing="0" cellpadding="2" width="350">
  81. <tr style="background-color: rgb(0,0,128); color: rgb(255,255,255)">
  82. <td width="342" style="background-color: rgb(0,0,128); color: rgb(255,255,255)"><font color="FFFFFF">¤提示信息</font></td>
  83. <td width="18" >
  84. <table border="1" bordercolorlight="666666" bordercolordark="FFFFFF" cellpadding="0" bgcolor="E0E0E0" cellspacing="0" width="18">
  85. <tr>
  86. <td width="16"><b><a href="javascript:history.go(-1)" onMouseOver="window.status='';return true" onMouseOut="window.status='';return true" title="关闭"><font color="000000">×</font></a></b></td>
  87. </tr>
  88. </table>
  89. </td>
  90. </tr>
  91. </table>
  92. <table border="0" width="350" cellpadding="4">
  93. <tr> 
  94.                   <td width="59" align="center" valign="top"><font face="Wingdings" color="#0099FF" style="font-size:32pt"><%=tmpkind%></font></td>
  95. <td width="269">
  96. <p><%=tmp%></p>
  97. </td>
  98. </tr>
  99. <tr>
  100. <td colspan="2" align="center" valign="top">
  101. <input type="button" name="ok" value=" 确 定 " onclick="<%=aa%>">
  102. </td>
  103. </tr>
  104. </table>
  105. </td>
  106. </tr>
  107. </table>
  108. </form>
  109. <%
  110. response.end
  111. end sub
  112. sub HtmlHead(Title)
  113. %>
  114. <html>
  115. <head>
  116. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  117. <link rel="stylesheet" href="style.css" type="text/css">
  118. <SCRIPT language=JavaScript>
  119.   <!--
  120. function click() {
  121. if (event.button == 2 | event.button == 3) {
  122. alert('[WEB网站管理系统]')
  123. }
  124. }
  125. //document.onmousedown=click oncontextmenu="return false" onkeydown="if(event.keyCode==78&&event.ctrlKey || event.keyCode==68&&event.ctrlKey)return false;" scroll="no"
  126.  //-->
  127. </SCRIPT>
  128. </head>
  129. <body bgcolor="#FFFFFF" leftmargin="2" topmargin="0" >
  130. <CENTER>
  131.   <table border="0" bgcolor="rgb(214,211,206)" cellspacing="1" align=center>
  132.     <tr>
  133.       <td>
  134.         <table border="0" bgcolor="rgb(214,211,206)" cellspacing="1" width="100%" style="font-family: 宋体; font-size: 10.5pt; border: 1px ridge">
  135.           <tr bgcolor=#adbee7>
  136.             <td  background="./images/public_top_bg.gif"><font color=#FFFFFF><%=Title%></font></td>
  137. <td bgcolor=#adbee7 width=10 valign=center><a href=# onClick="window.location.href ='workmng.asp'"><img src="./images/close.gif" border=0 ></a>
  138. </td>
  139. </tr>
  140.         </table>
  141.         <table border="0" bgcolor="rgb(214,211,206)" cellspacing="1" style="font-family: 宋体; font-size: 10.5pt; border: 1px ridge">
  142.           <tr>
  143.           <td valign="top">&nbsp; </td>
  144.             <td align="center" >
  145. <%end sub
  146. sub HtmlEnd()
  147. %>
  148.             </td>
  149.             <td valign="top">&nbsp; </td>
  150.           </tr>
  151.         </table>
  152.       </td>
  153.     </tr>
  154.   </table>
  155. </CENTER>
  156. </BODY>
  157. </HTML>
  158. <%
  159. end sub
  160. function GetID(strSQL) 
  161.   set tmpSql1=conn.execute(strSQL)
  162.   if tmpSql1(0)<>"" then
  163.     GetID=tmpSql1(0)
  164.   else
  165.     GetID=1
  166.   end if
  167. end function
  168. function GetName(strSQL)
  169.   set tmpSql1=conn.execute(strSQL)
  170.   if not tmpSql1.eof then
  171.     GetName=tmpSql1(0)
  172.   else
  173.     GetName=""
  174.   end if  
  175. end function
  176. '/////////加密/解密字符
  177. Function Encrypt(strSource) 
  178.   Dim Key1 
  179.   Dim Key2 
  180.   Dim bLowData 
  181.   Dim bHigData 
  182.   Dim i 
  183.   Dim strEncrypt
  184.   Dim strChar 
  185.   Key1 = 65
  186.   Key2 = 135
  187.   For i = 1 To Len(strSource)
  188.     strChar = Mid(strSource, i, 1)
  189.     bLowData = AscB(MidB(strChar, 1, 1)) Xor Key1
  190.     bHigData = AscB(MidB(strChar, 2, 1)) Xor Key2
  191.     strEncrypt = strEncrypt & ChrB(bLowData) & ChrB(bHigData)
  192.   Next
  193.   Encrypt = strEncrypt
  194. End Function
  195. '程序:王星亮 网名:血饮狂刀 国外的叫我LANBOO
  196. 'OICQ:40001
  197. 'EMAIL:webmaster@xytime.com
  198. '我是什么都有,您想要我开发什么程序,尽管说。只要价格合理就行。
  199. '我电话:13308715776 0871-3394913
  200. %>