⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editreco.asp

📁 汉化dataadmin1.1版,这是一套经过汉化的数据库管理系统软件
💻 ASP
字号:
<%@ LANGUAGE="VBScript" %>
<!--#include file="globvars.asp"-->
<!--#include file="commfunc.asp"-->
<%
if session("DataAdmi_Access")=0 then
  response.redirect RediPage
end if
%>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 2.0">
<title>D数据修改删除增加</title>
<%
Dim FielName, FielValu, PageNumb, FormActi

FielName = Request.QueryString("fn")
FielValu = CInt(Request.QueryString("fv"))
PageNumb = CInt(Request.QueryString("pg"))
FormActi = "editresu.asp?fn=" & FielName & "&fv=" & FielValu & "&pg=" & PageNumb


Function fiel_size(ByVal f)

' Input:  f = field object
' Output: return field size

  Dim x

  if f.Type = adTinyInt then
    x = 3
  elseif f.Type = adSmallInt then
    x = 6
  elseif f.Type = adInteger then
    x = 11
  elseif f.Type = adVarChar OR f.Type = adChar then
    x = f.DefinedSize
  elseif f.Type = adLongVarChar then
    x = 0
  else
    x = 40
  end if

  fiel_size = x
End Function


Function fiel_type(ByVal f)

' Input:  f = field object
' Output: return field type sting

  Dim s

  if f.Type = adSmallInt then
    s = "(整型, -32,768 to 32,767)"
  elseif f.Type = adInteger then
    s = "(长整, -2,147,483,648 to 2,147,483,647)"
  elseif f.Type = adSingle then
    s = "(单精, -3.4 x 10(38) to 3.4 x 10(38))"
  elseif f.Type = adDouble then
    s = "(双精, -1.797 x 10(308) to 1.797 x 10(308))"
  elseif f.Type = adCurrency then
    s = "(货币)"
  elseif f.Type = adBoolean then
    s = "(布尔)"
  elseif f.Type = adUnsignedTinyInt then
    s = "(Byte, 0 to 255)"
  elseif f.Type = adChar then
    s = "(字符)"
  elseif f.Type = adDBDate then
    s = "(日期)"
  elseif f.Type = adDBTime then
    s = "(时间)"
  elseif f.Type = adDBTimeStamp then
    s = "(日期/时间)"
  elseif f.Type = adVarChar then
    s = "(变长字符)"
  elseif f.Type = adLongVarChar then
    s = "(备注)"
  else
    s = "(" & f.Type & ")"
  end if

  fiel_type = s
End Function


Function fiel_stri(fv)

' Input:  fv = field value, NULL or other
' Output:

  Dim s

  if IsNull(fv) then
    s = " "
  else
    s = CStr(fv)
  end if
  fiel_stri = s
End Function
%>
</head>

<body bgcolor="#FFFFFF">

<table border="0" cellpadding="8" cellspacing="0" width="100%">
    <tr>
        <td valign="top" width="85%"><p align="center"><font
        color="#FF0000" size="3" face="Verdana"><strong>数据编辑</strong></font></p>
        <form action="<% response.write FormActi %>"
        method="POST">
        <p align="center"><font size="4"><strong>记录:</strong></font><font
            size="2"> </font> 
          <input type="submit" name="submit"
            value="修改">
          <input type="submit" name="submit"
            value="增加">
          <input type="submit" name="submit"
            value="删除">
          <input type="reset" value="清空" name="reset">
          <br>
          <a href="datalist.asp?pg=<%=PageNumb%>"><font
            size="2"><strong>返回列表</strong></font></a><font
            size="2"><strong> | </strong></font><a
            href="admilogi.asp"><font size="2"><strong>登陆 </strong></font></a><font size="2"><strong> 
          | </strong></font><a
            href="<%=HomePage%>"><font size="2"><strong>首页</strong></font></a></p>
        <p align="left"><font size="2">数据库: </font><font
            color="#008000" size="3"><strong><% response.write session("DataAdmi_DataName") %></strong></font><font
            size="2"><br>
          表 名: </font><font color="#008000" size="3"><strong><% response.write session("DataAdmi_TablName") %></strong></font></p>
            <p><%
Dim Conn, Str, Sql, Rec, Siz

call open_data(Conn, session("DataAdmi_DataName"))
Sql = "SELECT * FROM " & session("DataAdmi_TablName") & " WHERE "
Sql = Sql & FielName & "=" & FielValu
Set Rec = Conn.Execute(Sql)

for each fld in Rec.Fields
  if fld.Attributes <> adAutoIncrement then
    Siz = fiel_size(fld)   '' Siz=0 => memo field
    Str = "<font size='2'>字段名:"
    Str = Str & fld.Name & "&nbsp;</font>"
    Str = Str & "<font size='2'><em>类型:" & fiel_type(fld) & "<br></font></em>"

    if Siz <> 0 then
      Str = Str & "<font size='2'><input type='text' size='"
      Str = Str & CStr(Siz) & "' name=" & fld.Name & " value='"
      Str = Str & fiel_stri(fld.Value) & "'></font><br>"
    else
      Str = Str & "<font size='2'><textarea name=" & fld.Name & " rows='8' cols='60'>"
      Str = Str & fld.Value & "</textarea></font><br>"
    end if
  end if
  response.write Str
next

Rec.close
set Rec = nothing
Conn.close
set Conn = nothing
%> </p>
        </form>
        </td>
    </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -