<!--#include file="QvodCms_Conn.asp"-->
<!--#include file="QvodCms_Check.asp"-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<TITLE>模板管理页面</TITLE>
<link href="skins/css/jaja_main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr><th colspan=2 background="Skins/images/tdbg.gif" class="title">&nbsp;执行SQL语句 <span style="color:#FF0000">注:一旦执行将不能还原操作,如果不了解SQL语句的站长请绕行，所有操作后果自行承担！</span></th>
</tr>
<tr><td class="td2">
<%Select Case Trim(Request.QueryString("action"))
Case "save"
Call OpenConn()
If Request.Form("Sql")<>"" then
	ExeSelectTF = (LCase(Left(Trim(Request.Form("Sql")),6)) = "select")
	Conn.Errors.Clear
	On Error Resume Next
	If ExeSelectTF = True then
		Set ExeResult = Conn.ExeCute(Request.Form("Sql"),ExeResultNum)
	Else
		Conn.ExeCute Request.Form("Sql"),ExeResultNum
	End if
	If Conn.Errors.Count<>0 Then
		ErrorTF = True
		Set ExeResult = Conn.Errors
	Else
		ErrorTF = False
	End If
End If
If ErrorTF = True Then%>
    <table width="100%" border=0 align=center cellpadding="4" cellspacing=1 class=tbtitle style="background: #cad9ea;">
    <tr bgcolor="#f5fafe">
    <td align="center">错误号</td>
    <td width="20%" align="center">来源</td>
    <td width="7%" align="center">描述</td>
    <td width="8%" align="center">帮助</td>
    <td width="15%" align="center">帮助文档</td>
    </tr>
	<%For sql_i=1 To Conn.Errors.Count:Set ErrObj=Conn.Errors(sql_i-1)%>
	<tr align="center" bgcolor="#f5fafe">
	<td><% = ErrObj.Number %></td>
	<td><% = ErrObj.Description %></td>
	<td><% = ErrObj.Source %></td>
	<td><% = ErrObj.Helpcontext %></td>
	<td><% = ErrObj.HelpFile %></td>
	</tr>
    <%Next%>
	</table>
<%Else%>
	<table width="100%" border=0 align=center cellpadding="4" cellspacing=1 class=tbtitle style="background: #cad9ea;">
	<%If ExeSelectTF = True Then%>
        <tr bgcolor="#f5fafe" align="center">
	    <%For Each FiledObj In ExeResult.Fields%>
        <td><strong><% = FiledObj.name %></strong></td>
	    <%Next%>
        </tr>
	    <%Do while Not ExeResult.Eof%>
        <tr bgcolor="#f5fafe" align="center">
	    <%For Each FiledObj In ExeResult.Fields%>
        <td><%If IsNull(FiledObj.value) or  FiledObj.value="" then Response.Write("&nbsp;") else Response.Write(FiledObj.value) end if%></td>
	    <%next%>
        </tr><%
		ExeResult.MoveNext
		Loop
	  Else%>
          <tr bgcolor="#f5fafe" align="center"><td><strong>执行结果</strong></td></tr>
          <tr bgcolor="#f5fafe" align="center"><td>共有<%=ExeResultNum&"条记录被影响"%></td></tr>
	  <%End If%>
<%End If%>
</TABLE>
<%Case Else%>
<table width="100%" border=0 align=center cellpadding="4" cellspacing=1 class=tbtitle style="background: #cad9ea;">
  <form action="?action=save" method="post">
    <tr bgcolor="#f5fafe"><td style="height:50px; padding-left:50px"><input size="100"name="sql" datatype="require" msg="请填写sql语句"></td></tr>
    <tr bgcolor="#f8fbfb"><td style="height:30px; padding-left:100px"><input type="submit" value="执  行" name=submit> <input name="" type="reset" value="重  置"></td></tr>
  </form>
  <tr bgcolor="#f8fbfb"><td>如查询语句:Select name_id,data_name from qvodcms_name where name_id>2 order by name_id desc</td></tr>
  <tr bgcolor="#f8fbfb"><td>如修改语句:Update qvodcms_name set data_status = 1 where name_id>2</td></tr>
  <tr bgcolor="#f8fbfb"><td>如删除语句:Delete from qvodcms_name where name_id>2</td></tr>
</table>
<script language="javascript">alert("该功能仅用于有一定技术基础的站长使用,如果不了解SQL语句请绕行");</script>
<%End Select%>
</td></tr>
</table>
</body>
</html>