⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_sql.asp

📁 俄罗斯方块源码 俄罗斯方块源码 俄罗斯方块源码
💻 ASP
字号:
<!-- #include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
if session("admin")="" then
  response.redirect "admin_login.asp"
end if

'15 执行sql语句
if not checkflag("15") then
  call mb("对不起,您没有执行SQL语句的权限!","",0)
end if

if trim(request.form("sql_run"))="yes" then
  call sql_run()
else
  call main()
end if

call closeconn()

function sql_run()
  on error resume next
  dim is_ok,sql
  is_ok=trim(request.form("is_ok"))
  sql=trim(request.form("sql"))
  
  if is_ok<>"yes" or sql="" then
    call mb("您还没有对执行本次SQL语句进行确定或没有输入SQL语句!","",0)
  end if
  
  if err then
    err.clear
    call mb("您刚才的操作在执行SQL语句前出现了意外的错误!\n\n"&sql&"\n\n请返回检查。","",0)
  end if
  
  err.clear
  conn.execute(sql)
  if err then
    err.clear
    call mb("系统在执行SQL语句时出现了系统或意外的错误!\n\n"&sql&"\n\n可能是您输入的SQL语句有错误存在!请返回检查。","",0)
  end if
  
  call mb("系统成功的执行SQL语句!\n\n"&sql,"admin_sql.asp",1)
end function

sub main()
%>
<link href="admin.css" rel="stylesheet" type="text/css"> <body leftmargin="5" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#000000" vspace="0" hspace="0">
  <tr bgcolor="#EFEBEF"> 
    <td height="27"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="86%"><font color="#FF3000">.:: 您可以在这里进行[ACCESS数据库]相关操作</font></td>
          <td width="14%" height="20" align="center"><a href="javascript:this.location.reload()"><img src="images/refresh.gif" alt="刷新" width="40" height="12" border="0"></a></td>
        </tr>
      </table></td>
  </tr>
  <tr > 
    <td height="1" bgcolor="#000000"></td>
  </tr>
</table>
<form action="admin_sql.asp" method="post" name="sql" id="sql">
  <table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td height="25" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr align="center"> 
            <td height="25"><input type=hidden name=sql_run value='yes'>请输入SQL语句:(请注意SQL语法,以减少错误!) <input type=checkbox 
              name=is_ok value='yes'> &nbsp;是否确定</td>
          </tr>
          <tr> 
            <td height="25" align="center"> 
              <input name="sql" type="text" class="input" id="sql" size="60">
            </td>
          </tr>
          <tr> 
            <td height="25" align="center"> 
              <input name="Submit" type="submit" class="button" value="执行">
              &nbsp;&nbsp;<font color="#FF0000">执行某项操作后将不能再恢复!<br>
              <br>
              在执行SQL语法前请先确定是否一定要执行!如果您不懂sql语法,请不要执行本页功能!!<br>
              </font></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<%
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -