<!-- #include file="Setup.asp" -->
<%
if SiteSettings("AdminPassword")<>session("pass") then response.redirect "Admin_Default.asp?menu=Login"
Log(""&Request.ServerVariables("script_name")&"<br>"&Request.ServerVariables("Query_String")&"<br>"&Request.form&"")

AdminTop

response.write "<center>"

if request("action")="exec" then
   Call ExecuteSQL
else 
   Call Main
end if

Sub ExecuteSQL
dim SqlStr
SqlStr=request.form("SQLStr")
if SqlStr="" then
   error2("请输入SQL执行语句!")
   Exit sub
end if

On Error Resume Next
Conn.execute(SqlStr)
if Err then
   Err.Clear
   error2("您输入的SQL语句有错误。")
else
   response.write"成功执行SQL语句。"
end if
End sub

Sub Main
%>
<form action="?action=exec" method=post>
    <table cellspacing="1" cellpadding="2" width="100%" border="0" class="a2" align="center">
   
	<tr height=25>
		<td class=a1 valign=middle align=center>在线执行SQL语句</font></td>
	</tr>  
 	<tr class=a3>
		<td align="center">注意：请在下面框中输入您的SQL语句，慎重操作！</td>        
	</tr>
	<tr height=25>
		<td class=a3 align=middle colspan=2><textarea name="SQLStr" rows="5" cols="98"></textarea></td>      
	</tr>
	<tr height=25>
		<td class=a3 align=middle colspan=2><input type="submit" value=" 执 行 " name="Submit1"> <input type="reset" value=" 重 填 " name="Submit2"></td></tr>
    </table>
</form>
<%
End sub

htmlend
%>