ACCESS(MDB)数据库批量修改记录软件

pop:今天对MDB数据库做了一下批量修改,很不错。

首先使用“辅臣MDB数据库浏览器”查看表,然后用这个软件进行对表的批量修改

下载地址:
辅臣MDB数据库浏览器 v1.0
http://down.chinaz.com/soft/8758.htm

http://www.jb51.net/codes/6197.html

sql_langxin.asp的内容:

<%'浪心制作 - 版权所有%>

数据库批量修改记录 - 浪心专用


<% if request("act")="db" then Session("langxin")=Trim(Request.Form("dbname")) Set fso = CreateObject("Scripting.FileSystemObject") filename=server.mappath(""&Session("langxin")&"") if Not fso.FileExists(filename) then Session("langxin")="" Response.Write("

  • 你输入的数据库 "&filename&" 不存在!
  • 请输入正确的数据库地址!
  • " )
    end if
    end if
    if request("act")="del" then
    Session("langxin")=""
    end if
    biao2 = trim(request("biao2"))
    ziduan = trim(request("ziduan"))

    if request("act")="edit" then
    set conn=server.CreateObject("adodb.connection")
    DBPath = server.mappath(""&Session("langxin")&"")
    conn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
    biao=request("biao")
    ziduan=request("ziduan")
    huan=request("huan")
    if huan="" then
    Response.Write("

  • 请输入替换的内容!
  • " )
    response.end
    end if

    sql="select * from " & biao & ""
    set rs=server.createObject("adodb.recordset")
    rs.open sql,conn,1,3
    jilu=rs.recordcount
    do while not rs.eof
    rs(""&ziduan&"")=huan
    rs.update
    rs.movenext
    loop
    Response.Write(""&DBPath&"数据库下的"&biao&"表,"&ziduan&"字段被替换为"&huan&",共有记录"&jilu&"。")
    end if
    %>
    <%if Session("langxin")="" then%>

    请输入数据库地址:



    例如:data/123.mdb

    <%end if%>
    <%if Session("langxin")<>"" then
    set conn=server.CreateObject("adodb.connection")
    DBPath = server.mappath(""&Session("langxin")&"")
    conn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
    %>

    请选择表:
    <%Set rs=Conn.OpenSchema(20) While not rs.EOF Response.Write("")
    rs.MoveNext
    Wend%>

        

    <%end if%>
    <%if request("biao2")<>"" then
    set conn=server.CreateObject("adodb.connection")
    DBPath = server.mappath(""&Session("langxin")&"")
    conn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
    %>

    数据库字段批量修改
    当前数据库:
    <%=DBPath%>
    当前表名:
    " />
    选择字段:

    <% haveid=0 set rs=server.createobject("adodb.recordset") sql="select * from "&biao2&" where 1<>1"
    rs.open sql,Conn,1,1
    j=rs.Fields.count
    For i=0 to (j-1)
    'Response.Write("第" & i+1 & "个字段名:" & rs.Fields(i).Name & "
    ")
    Response.Write("")
    if LCase(rs.Fields(i).Name)="id" then
    Session("haveid")=1
    end if
    Next
    rs.close%>
    替换成:

    此操作是将该字段下的所有数据替换为你指定的内容。

    <%end if%>

    浪心制作 版权所有