当前位置: 网学 > 编程文档 > ASP > 正文

在线数据库管理工具(db007) v1.5

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
if
if request("null") = "" then
sql = sql & " not null"
end if
if request("autoincrement") = "y" then
sql = sql & " identity"
end if
sql = trim(sql)
conn.execute(sql)
response.redirect "?key=view&table_name="& request("table_name")
end sub

''==================================================================添加字段函数
sub addfield()
on error resume next
fldname = request("fldname")
fldtype = request("field_type")
fldsize = request("fldsize")
fldnull = request("null")
fldautoincrement = request("autoincrement")
table_name = request("table_name")
if fldname <> "" and fldtype <> "" then
sql = "alter table [" & table_name & "] add ["&fldname&"] " & fldtype

if fldsize <> "" then
sql = sql & "(" & fldsize & ")"
end if

if fldnull <> "ON" then
sql = sql & " not null"
end if

if fldautoincrement = "ON" then
sql = sql & " identity"
end if
conn.execute(sql)
response.redirect "?key=view&table_name=" & table_name
else
echo "输入数据错误!<input type=''button'' name=''ok'' value='' 返 回 '' onClick=''javascript:history.go(-1)''>"
end if
if err <> 0 then
echo err.description
echo "<input type=''button'' name=''ok'' value='' 返 回 '' onClick=''javascript:history.go(-1)''>"
response.end
end if
end sub


''==================================================================编辑数据
sub editdata()
dim keys,names,values,action,rs,sql,tab
on error resume next
keys = request("primarykey")
names = request("table_name")
values = request("primarykeyvalue")
action = request("action")
Set rs = Server.CreateObject("Adodb.RecordSet")
if action = "" or action = "save" or action = "new" then
sql = "select * from " & names & " where " & keys & " = " & values
end if
if action = "pre" then
sql = "select top 1 * from " & names & " where " & keys & " < " & values & " order by " & keys & " desc"
end if
if action = "next" then
sql = "select top 1 * from " & names & " where " & keys & " > " & values & " order by " & keys & " asc"
end if
if action = "add" then
sql = "Select * From [" & names & "]"
end if
rs.Open sql, conn, 1, 3

if rs.eof and action = "new" then
sql = "Select * From [" & names & "]"
rs.Open sql, conn, 1, 3
end if

if action = "save" or action = "new" then
If action = "new" Then rs.AddNew
For Each tab In rs.Fields
If Keys <> tab.Name Then
rs(tab.Name) = Request.Form(tab.Name & "_Column")
if err <> 0 then
echo tab.name & err.description
echo "<input type=''button'' name=''ok'' value='' 返 回 '' onClick=''javascript:history.go(-1)''>"
respon
  • 上一篇资讯: ASP中过滤UBB和Html标签
  • 下一篇资讯: Response.Flush的使用心得
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号