<!--#include file ="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
Dim str
Dim num
Dim i
Dim strl
Dim lr
Dim lb
Dim le
Dim tname
Dim sql
Dim FD
Dim kd
num = Request.QueryString("num")
tname = Request.QueryString("t")
for i=0 to num
FD = FD & Request.Form("aa"&i&"") & "|"
str = str & Left(Request.Form("LB"&i&""),2) & "|"
strl = strl & Request.Form("CD"&i&"") & "|"
next
lr = split(str,"|")
lb = split(strl,"|")
kd = split(FD,"|") 
le ="[id] int identity(1,1) primary key clustered,"
 for i=0 to Cint(Ubound(lr)-1)
if i = Cint(Ubound(lr)-2) then 
  select case lr(i)
  case "字符"
      le =le & kd(i) & " varchar("&lb(i)&")"
  case "链接"
      le =le &kd(i) & "  varchar(212)"
  case "图片"
      le =le &kd(i) & "  varchar(211)"
  case "整数"
      le=le &kd(i) &  " int"
  case "数字"
      le=le &kd(i) &  " NUMERIC"
  case "日期"
      le=le &kd(i) &  " date"
  case "备注"
      le=le &kd(i) &  " MEMO"
 end select
Else
 select case lr(i)
  case "字符"
      le =le & "[" & kd(i) & "]" & " varchar("&lb(i)&"), "
  case "链接"
      le =le & "[" & kd(i) & "]" & " varchar(212), "
  case "图片"
      le =le & "[" & kd(i) & "]" & " varchar(211), "
  case "整数"
      le=le & "[" & kd(i) & "]" &  " int, "
  case "数字"
      le=le & "[" & kd(i) & "]" &  " NUMERIC, "
  case "日期"
      le=le & "[" & kd(i) & "]" &  " date, "
  case "备注"
      le=le & "[" & kd(i) & "]" &  " MEMO,"
 end select
 End If  
next
sql = "create table "&tname&"("&le&")"
conn.execute(sql)
JaSys("管理员" & session("ManagerUser")&"创建数据表<font color=red>["&tname&"]</font>")
Set conn=nothing
erase lr
erase lb
erase kd
Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('数据表创建成功!');" & Chr(13)
		Response.write "window.document.location.href='JaAcc_Manage.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
    Response.End
%>




