<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include File="../conn/conn.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="/Blue/Blue.css" type="text/css" />
<link rel="stylesheet" href="/images/General.css" type="text/css" />
<title>ASP在线执行SQL语句-在线远程控制数据库</title>
</head>
<body>
<%
if request("act")="DoExeCuteSql" then
  call DoExeCuteSql()
    Else
%>
<table width="100%" border="0">
  <tr>
    <td width="39%">&nbsp;</td>
    <td width="54%">请输入您的SQL语句</td>
    <td width="7%">&nbsp;</td>
  </tr>
</table>

<form action="?act=DoExeCuteSql" method="post" name="form" id="form">
  <div align="center" >
    <textarea name="Content"  rows="5" wrap="OFF" id="Content" style="width:100%" ></textarea>
    <br />
    <input name="Submit" type="submit" value="执行SQL语句">
    <input name="Rest" type="reset" value="重写">
  </div>
</form>
<% End If %>
</body>
</html>
<%
'//执行Sql语句操作
Sub DoExeCuteSql()
 Dim Content
 Content=Request("Content")
 Err.Clear
 On Error Resume Next
 Conn.BeginTrans
 Conn.ExeCute(Content)
 If Err.Number<>0 Then
 Conn.Rollback
 Response.Write("<script>alert(""<执行失败>\nSQL语句有误,请检查你的SQL语句.\nFor Aspid.cn"");window.history.back();</script>")
 Else
 Conn.CommitTrans

 Response.Write("<script>alert(""<执行成功>\nSQL语句执行完毕\nFor Aspid.cn"");window.history.back();</script>")
 End If
 Response.End
End Sub
%>

