要将VIEW中的PIC数据批量复制到Special中,(歌手名与专辑要完全相同),代码如下: <% dim conn dim connstr 'on error resume next connstr="DBQ="+server.mappath("p#1.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" set conn=server.createobject("ADODB.CONNECTION") On Error Resume Next conn.open connstr %>
管理软件
<% const MaxPerPage=100 dim totalPut dim CurrentPage dim TotalPages dim i,j if not isempty(request("page")) then currentPage=cint(request("page")) else currentPage=1 end if %> <% set rs=server.CreateObject("adodb.recordset") rs.open "select * from Special inner join view on Special.name =view.name and Special.NClass=view.NClass",conn,1,1 if rs.eof and rs.bof then response.write "
暂无软件
" else totalPut=rs.recordcount totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut MaxPerPage else currentpage= totalPut MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"l.asp" else if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rs.bookmark showContent showpage totalput,MaxPerPage,"l.asp" else currentPage=1 showContent showpage totalput,MaxPerPage,"l.asp" end if end if rs.close end if
set rs=nothing conn.close set conn=nothing sub showContent dim i i=1 %> <%do while not rs.eof%>
<%dim picc,vname,vnclass picc=rs("pic") vname=rs("name") vnclass=rs("nclass")%><% sql="update Special set pic='"&picc&"' where name='"&vname&"' and nclass='"&vnclass&"' " conn.execute sql %>
<% i=i+1 if i>=MaxPerPage then exit do rs.movenext loop %>
<% end sub function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber maxperpage else n= totalnumber maxperpage+1 end if if CurrentPage<2 then response.write "" else response.write "首页 " response.write "上一页 " end if if n-currentpage<1 then response.write "" else response.write "" response.write "下一页尾页" end if response.write " 页次:"&CurrentPage&"/"&n&"页 " response.write " 共"&totalnumber-1&"个软件 "&maxperpage&"个软件/页" end function %>