在线数据库管理工具(db007) v1.5(15)
sub reobj()
on error resume next
Dim mydb,mytable,tablename
tablename = request("tablename")
Set mydb = Server.CreateObject("ADOX.Catalog")
mydb.ActiveConnection = conn
if request("obj") = "field" then '修改字段名
dim fieldsname,newfieldsname
fieldsname = request("fieldsname")
newfieldsname = request("newfieldsname")
Set mytable = Server.CreateObject("ADOX.Table")
Set mytable = mydb.Tables(tablename)
mytable.Columns(fieldsname).Name = newfieldsname
end if
if request("obj") = "table" then '修改表名
dim newtablename
newtablename = request("newtablename")
mydb.Tables(tablename).Name = newtablename
end if
if err <> 0 then
echo err.description
echo "<input type='button' name='ok' value=' 返 回 ' onClick='javascript:history.go(-1)'>"
exit sub
end if
if request("obj") = "field" then
response.Redirect "?key=view&table_name=" & tablename
else
response.Redirect "?key=view&table_name=" & newtablename
end if
end sub
'==================================================================查看表结构函数
sub view(table_name)
'table_name = 表名称
dim rs,sql,table,primary,primarykey,i,editstr,typs
on error resume next
table = table_name
Set primary = Conn.OpenSchema(adSchemaPrimaryKeys,Array(empty, empty, table))
if primary("COLUMN_NAME") <> "" then
内容版权声明:除非注明,否则皆为本站原创文章。