设为首页收藏本站
网站公告 | 这是第一条公告
     

 找回密码
 立即注册
缓存时间10 现在时间10 缓存数据 大雨过后,彩虹深处,全世界的颜色都在我眼里,全世界的浪漫都在我手心,早安!加油!

大雨过后,彩虹深处,全世界的颜色都在我眼里,全世界的浪漫都在我手心,早安!加油!

查看: 1100|回复: 1

批量复制数据

[复制链接]
  
           
<% 
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 
%> 
     
  
 

  离线 

TA的专栏

  • 打卡等级:热心大叔
  • 打卡总天数:220
  • 打卡月天数:0
  • 打卡总奖励:3209
  • 最近打卡:2025-03-29 10:11:44
等级头衔

等級:晓枫资讯-上等兵

在线时间
0 小时

积分成就
威望
0
贡献
410
主题
375
精华
0
金钱
4414
积分
828
注册时间
2023-1-9
最后登录
2025-5-31

发表于 2023-2-14 16:21:13 | 显示全部楼层 |阅读模式
  
 
 
<% i=i+1 
if i>=MaxPerPage then exit do 
rs.movenext 
loop 
%> 
现有表Special和表view数据结构相同的两个表:

Special
Specialid       NClass        name           pic
1                   黎明          火舞艳阳
2                   张学友      地久天长
3                   陈冠希      同名专辑
4                   郭富城      听风的歌
view
Specialid       NClass        name           pic
1                   黎明          火舞艳阳      photo/200606192321.jpg
2                   张学友      地久天长      photo/200606192327.jpg
3                   刘德华      如果有一天 photo/200606192328.jpg
4                   郭富城      听风的歌      photo/200606192329.jpg

要将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 
%>
 
       
        
 
 
 
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
晓枫资讯-科技资讯社区-免责声明
免责声明:以上内容为本网站转自其它媒体,相关信息仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同其观点或证实其内容的真实性。
      1、注册用户在本社区发表、转载的任何作品仅代表其个人观点,不代表本社区认同其观点。
      2、管理员及版主有权在不事先通知或不经作者准许的情况下删除其在本社区所发表的文章。
      3、本社区的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,举报反馈:点击这里给我发消息进行删除处理。
      4、本社区一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
      5、以上声明内容的最终解释权归《晓枫资讯-科技资讯社区》所有。
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~
回复

举报 送花

  离线 

TA的专栏

等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
19
积分
18
注册时间
2022-12-27
最后登录
2022-12-27

发表于 2025-3-21 08:28:02 | 显示全部楼层
感谢楼主,顶。
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~
返回列表 发新帖
严禁发布广告,淫秽、色情、赌博、暴力、凶杀、恐怖、间谍及其他违反国家法律法规的内容。!晓枫资讯-社区
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1楼
2楼

手机版|晓枫资讯--科技资讯社区 本站已运行

CopyRight © 2022-2025 晓枫资讯--科技资讯社区 ( BBS.yzwlo.com ) . All Rights Reserved .

晓枫资讯--科技资讯社区

本站内容由用户自主分享和转载自互联网,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。

如有侵权、违反国家法律政策行为,请联系我们,我们会第一时间及时清除和处理! 举报反馈邮箱:点击这里给我发消息

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表