ub editfidlevi()
dim sql,rs,i
on error resume next
sql = "Select * From [" & request("table_name") & "]"
set rs = conn.execute(sql)
for i = 0 to rs.fields.count - 1
if rs(i).name = request("fidle") then
%>
<script LANGUAGE="JavaScript">
function validate(theForm) {
if (theForm.type.value == "")
{
alert("请输入数据类型");
theForm.type.focus();
return (false);
}
return (true);
}
</script>
<font color=red>修改字段属性:</font>
<form action="?key=editfidle&fidle=<%=request("fidle")%>&table_name=<%=request("table_name")%>" method="post" name=frm onSubmit="return validate(frm)">
<table width="600" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="60" height="20" align="center">字段名</td>
<td width="50" height="20" align="center">类型</td>
<td width="58" height="20" align="center">设定大小</td>
<td width="64" height="20" align="center">允许空值</td>
<td width="66" height="20" align="center">自动编号</td>
<td width="96" height="20"></td>
</tr>
<tr>
<td width="60" height="20" align="center"><%=rs(i).name%></td>
<td width="50" height="20" align="center">
<% fieldtypelist(request("fidletype")) %>
</td>
<td width="58" height="20"><input type="text" name="size" size="10"></td>
<td width="64" height="20" align="center">
<input type="checkbox" name="null" value="null"<%=iif((rs(i).Attributes and adFldIsNullable)=0,""," checked")%>>
</td>
<td width="66" height="20" align="center">
<input type="checkbox" name="autoincrement" value="y"<%=iif(rs(i).Properties("ISAUTOINCREMENT") = True," checked","")%>>
</td>
<td width="96" height="20" align="center">
<input type="submit" name="Submit" value="提交">
</td>
</tr>
</table><br>
</form>
<%
end if
next
end sub
''==================================================================执行修改字段属性
sub editfidle()
on error resume next
sql = "ALTER TABLE [" & request("table_name") & "] "
sql = sql&"ALTER COLUMN [" & request("fidle") & "] "
if request("field_type") <> "" then
sql = sql & request("field_type")
end if
if request("size") <> "" then
sql = sql & "(" & request("size") & ") "
end