<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p04")
'''''''''''''''''''''''''''''''''''''''''''''''
dim sql
    sql=request.QueryString("sql")
%>
<html>
<head>
<title>数据库在线管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	font-size:12px;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {	color: #FFFFFF;
	font-weight: bold;
}
ul{ margin:0; text-align:left; list-style:none;}
li{ margin:0 5px 0 5px; float:left; list-style:none; list-style-type:none; padding:0;}
.tb{ float:left; margin:0; padding:0; text-align:center; width:80px;}
.tab{ widows:20px; margin:0; padding:0; float:left;}
-->
</style>
<link href="style/global.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #FF0000}
-->
</style>
</head>
<body>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>

<table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
  <tr>
    <td height="22" bgcolor="#FF9900"><div align="center"><span class="style1">◆ Sql测试 ◆</span></div></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#FFFFFF" style="padding:10px; "><form name="form1" method="get" action="">
      sql：
      <textarea cols="55" rows="5">
      <%=sql%>
      </textarea>
      <input type="submit" name="button" id="button" value="执行">
    </form>
    结果集：<br>

		<%    
		if(sql<>"") then
			response.Write("<table width=""100%""  border=""1"" cellpadding=""0"" cellspacing=""1"">")
			set rs=server.createobject("adodb.recordset")
			rs.open sql,conn,3,1
			response.Write("<tr>")
			for i=0 to rs.fields.count-1
					response.write("<td height=""24"">"&rs.fields(i).name&"</td>")
			next
			response.Write("</tr>")
			
			while not rs.eof
				response.Write("<tr>")
				for i=0 to rs.fields.count-1
						response.write("<td height=""24"">"&rs(i)&"</td>")
				next
				rs.movenext
				response.Write("</tr>")
			wend
			
			rs.close
			set rs=nothing
			response.Write("</table>")
		end if
    %>
		</td>
  </tr>
</table>
<p align="center"><input type="submit" name="button2" id="button2" value="关闭窗口" onClick="window.close()"></p>
</body>
</html>
<%
call connclose()
%>