<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p10")
'''''''''''''''''''''''''''''''''''''''''''''''
dim act,tablename
act=trim(request.QueryString("act"))
tablename=trim(request.Form("tablename"))
if(act="create") then
	'if(DbType=0) then
		'conn.execute("Create table "&tablename&"(id AUTOINCREMENT(1,1),primary key(id))")
	'else
		conn.execute("Create table "&tablename&"(id int IDENTITY (1, 1) NOT NULL,primary key(id))")
	'end if
	response.Redirect("sql.asp")
end if
%>
<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">◆ 数据库管理 ◆</span></div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" style="padding:10px; "><img src="images/table.gif" align="absmiddle"> tot_news库中的表：<br>
      <br>
<%
'conn.execute("alter table recommen MODIFY(newsid long)")修改字段
dim i,str
i=1
set rsSchema=conn.openSchema(20)
rsSchema.movefirst
Do Until rsSchema.EOF
if(i mod 6=0) then
	str="<div style="" clear:both""><br><br></div>"
else
	str="<div class=""tab"">&nbsp;&nbsp;</div>"
end if
if rsSchema("TABLE_TYPE")="TABLE" then
	response.Write("<div class=""tb""><a href=""table_detail.asp?tablename="&rsSchema("TABLE_NAME")&"""><img border=""0"" src=""images/table.gif"" width=""23"" height=""19"" align=""absmiddle""><br>")
	response.write(rsSchema("TABLE_NAME")&"</a></div>"&str&chr(10))
end if
rsSchema.movenext
i=i+1

Loop
rsSchema.close
set rsSchema=nothing
%>
</td>
  </tr>
</table>
<div align="center">
  <p align="left"><br>
  <fieldset>
  <div align="left">
     <legend>创建新表</legend>
     <form name="form1" method="post" action="sql.asp?act=create" onSubmit="return check(this)">
       <div align="center">表名：
         <input type="text" name="tablename">
         <input type="submit" name="Submit" value="创  建==>">
       </div>
     </form>
  </div>
  </fieldset></p>
  <p><span class="style2">注</span>：test表为对不熟悉数据库操作的用户所建，可以在线任意修改，以熟练对表的操作，对其它的表的操作要慎重!</p>
</div>
<script type="text/javascript">
function check(obj){
	if(obj.tablename.value==""){
		alert('表名称不能为空!');
		obj.tablename.focus();
		return false;
	}
	return true;
}
</script>
</body>
</html>
<%
call connclose()
%>