<!--#include file ="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK href="admin/admin.css" type=text/css rel=stylesheet><script language="JavaScript" src="admin/js.js"></SCRIPT></head>
<%
Dim a
Dim cname
Dim lname
Dim tname
Dim Cat
Dim ctype
Dim lb
Dim le
tname = Trim(Request.QueryString("tname"))
i = Cint(Request.Form("i"))
lname = Trim(Request.Form("lname"))
for a=0 to i-1
cname = cname & Request.Form("f"&a&"") & "|"
ctype = ctype & left(Request.Form("LB"&a&""),2) & "|"
lb = lb & Request.Form("CD"&a&"") & "|"
next
lname = split(lname,"|")
cname = split(cname,"|")
ctype = split(ctype,"|")
lb = split(lb,"|")

Set Cat=Server.CreateObject("ADOX.Catalog")
Cat.ActiveConnection="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
for a=0 to i-1
If lname(a)<>"id" or lname(a)<>"ID" Then
Cat.Tables(""&tname&"").Columns(""&lname(a)&"")=""&cname(a)&""

 select case ctype(a)
  case "字符"
      le = cname(a) & " varchar("&lb(a)&")"
  case "链接"
      le =cname(a) & "  varchar(212)"
  case "图片"
      le =cname(a) & "  varchar(211)"
  case "整数"
      le=cname(a) &  " int"
  case "数字"
      le=cname(a) &  " NUMERIC"
  case "日期"
      le=cname(a) &  " date"
  case "备注"
      le=cname(a) &  " MEMO"
 end select
Call ModColumn(tname,le)
End If
next 
 
Set Cat=Nothing
Sub ModColumn(TableName,ColumnName)
	On Error Resume Next
	Conn.Execute("Alter Table "&TableName&" Alter Column "&ColumnName&"")
	If Err Then
		Response.Write TableTop & "更改 "&TableName&" 表中字段属性<font color=blue>错误</font>，请手动将数据库中 <B>"&ColumnName&"</B> 字段更改为 <B>"&ColumnType&"</B> 属性，原因" & Err.Description & "<BR>" & TableEnd
		Err.Clear
		Response.Flush
	Else
		Response.Write TableTop & "更改 "&TableName&" 表中字段属性 "&ColumnName&" 成功 <BR>" & TableEnd
		Response.Flush
	End If
End Sub

erase lname
erase cname
erase ctype
erase lb 
%>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="30">
<div align="center"><a href="JaAcc_Manage.asp">返回数据表页面</a> <A href="javascript:history.back()">返回上一页</a></div></td>
  </tr>
</table>

