home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / wh / qim / Ft_conn.asp < prev    next >
Text File  |  2006-06-01  |  3KB  |  101 lines

  1. <%
  2. '==================================
  3. '=╬─ ╝■ ├√ú║conn.asp
  4. '=╩╩╙├░µ▒╛ú║FeitecCMS AC V1.3 Free
  5. '=╣ª    ─▄ú║═°╒╛╩²╛▌┐Γ┴¼╜╙╝░╣½╙├╣²│╠╗≥║»╩²
  6. '=╫≈    ╒▀ú║╙Ω│╟[From to FeitecStudio]
  7. '=╚╒    ╞┌ú║2006-2-19 18:09
  8. '=░µ    ╚¿ú║http://www.feitec.com/
  9. '=╝╝╩⌡╠╓┬█ú║6602510íó14040543ú¿╨┬╩╓╚║ú⌐
  10. '==================================
  11. on error resume next
  12. '╩²╛▌┐Γ╡╪╓╖╔Φ╓├ú¼╕∙╛▌╧α╙ª╟Θ┐÷╫≈╕ⁿ╕─ú¼├√│╞╘╜╕┤╘╙╘╜║├íú
  13. dim conn,connstr,db
  14. db="data#v390/feitec#data.asa"
  15. connstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(db)
  16. set conn = server.createobject("adodb.connection")
  17. conn.open connstr
  18.     if err then
  19.         err.clear
  20.         set conn = nothing
  21.         response.write "╩²╛▌┐Γ┴¼╜╙│÷┤φú¼╟δ╝∞▓Θ┴¼╜╙╫╓┤«íú"
  22.         response.end
  23.     end if
  24.  
  25. '╣╪▒╒╩²╛▌┐Γ┴¼╜╙║»╩²
  26. function closedatabase
  27.     conn.close
  28.     set conn = nothing
  29. end function
  30. '==================================
  31. '=║» ╩² ├√ú║checksql(name,str,attrib,num)
  32. '=╣ª    ─▄ú║╖╔╠┌╣ñ╫≈╩╥│¼╟┐╩²╛▌╝∞▓Γ╣²┬╦║»╩²ú¼▒╛╒╛╘¡┤┤
  33. '=╩╣╙├╦╡├≈ú║name-▓╬╩²├√ú¿╙├╙┌┤φ╬≤╧╘╩╛ú⌐ú¼str-▓╬╩²╓╡ú¿╙├╙┌┼╨╢╧ú⌐ú¼attrib-▓╬╩²└α╨═ú¿1╬¬╫╓╖√╨═ú¼0╬¬╩²╫╓╨═ú⌐ú¼num-▓╬╩²╓╡╫╓╖√╩²┴┐ú¿╫╓╖√╨═╓╨0▒φ╩╛▓╗╧▐╓╞ú¼╩²╫╓╨═╚╬║╬╟Θ┐÷╧┬╢╝╙╨╧▐╓╞ú⌐
  34. '==================================
  35. Function checksql(name,str,attrib,num)
  36.     dim founderr,errmsg
  37.     founderr=false
  38.     errmsg=""
  39.     dim sqlname
  40.     sqlname=name
  41.     if attrib=1 then
  42.         if str="<P> </P>" or str="<P></P>" or str="<BR>" then
  43.             str=""
  44.         else
  45.             str=trim(replace(str,"'",""))
  46.         end if
  47.         if str="" then
  48.             founderr=true
  49.             errmsg=errmsg+"<br><li>"&sqlname&"▓╗─▄╬¬┐╒úí</li>"
  50.         elseif num<>0 then
  51.             dim Bword(12) 
  52.             Bword(0)="--" 
  53.             Bword(1)=";" 
  54.             Bword(2)=">" 
  55.             Bword(3)="<" 
  56.             Bword(4)="chr(32)" 
  57.             Bword(5)="í»" 
  58.             Bword(6)="í▒í▒" 
  59.             Bword(7)="chr(9)" 
  60.             Bword(8)="%" 
  61.             Bword(9)="$" 
  62.             Bword(10)="'" 
  63.             Bword(11)="chr(34)" 
  64.             Bword(12)="|" 
  65.             for i= 0 to ubound(Bword) 
  66.                 if instr(str,Bword(i))<>0 then 
  67.                     founderr=true
  68.                     errmsg=errmsg+"<br><li>"&sqlname&"╓╨║¼╙╨╖╟╖¿╫╓╖√ú¿╕≈╓╓╖√║┼ú⌐úí</li>"
  69.                 end if 
  70.             next 
  71.             if len(str)>num then
  72.                 founderr=true
  73.                 errmsg=errmsg+"<br><li>"&sqlname&"▓╗─▄│¼╣²"&num&"╫╓╖√úí</li>"
  74.             end if
  75.         elseif instr(str,"'")<>0 then
  76.             founderr=true
  77.             errmsg=errmsg+"<br><li>"&sqlname&"╓╨╙╨╖╟╖¿╫╓╖√úí</li>"
  78.         end if
  79.     elseif attrib=0 then
  80.         if str="" then
  81.             founderr=true
  82.             errmsg=errmsg+"<br><li>"&sqlname&"▓╗─▄╬¬┐╒úí</li>"
  83.         elseif not isnumeric(str) then
  84.             founderr=true
  85.             errmsg=errmsg+"<br><li>"&sqlname&"▓╗╩╟╩²╫╓╨═úí</li>"
  86.         elseif len(str)>num then
  87.             founderr=true
  88.             errmsg=errmsg+"<br><li>"&sqlname&"╩²╫╓╨═▓╬╩²╬╗╩²▓╗─▄│¼╣²"&num&"╬╗úí</li>"
  89.         end if
  90.     else
  91.             founderr=true
  92.             errmsg=errmsg+"<br><li>╣²┬╦║»╩²╡≈╙├┤φ╬≤úí</li>"
  93.     end if
  94.     if founderr then
  95.         response.redirect("showerr.asp?errmsg="&errmsg&"")
  96.         response.end
  97.     end if
  98.     checksql=str
  99. End Function
  100. %>
  101.