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%>
<%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
%>
<%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
%>
<%end if%>
浪心制作 版权所有