批量复制数据
网络编程 2021-07-05 10:58www.168986.cn编程入门
现有表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中,(歌手名与专辑要完全相同),代码如下:
代码如下:
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 Aess Driver (.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
On Error Resume Next
conn.open connstr
%>
<html>
<head>
<title>管理软件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000" >
<table width=700 border="0" cellspacing="0" cellpadding="0" align="center"><%
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 "<p align=center class=font>暂无软件</p>"
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<totalPut then
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%>
<tr>
<td><%dim pi,vname,vnclass
pi=rs("pic")
vname=rs("name")
vnclass=rs("nclass")%><%
sql="update Special set pic='"&pi&"' where name='"&vname&"' and nclass='"&vnclass&"' "
conn.execute sql
%></td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="21" bgcolor="#F7F7F7" align="center">
<%
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 "<a href="&filename&"?page=1>首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write ""
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
end if
response.write " 页次</font><b><font color=red>"&CurrentPage&"</font>/"&n&"</b>页</font> "
response.write " 共<b>"&totalnumber-1&"</b>个软件 <b>"&maxperpage&"</b>个软件/页"
end function
%>
</td>
</tr>
</table>
</body>
</html>
dim conn
dim connstr
'on error resume next
connstr="DBQ="+server.mappath("p#1.mdb")+";DefaultDir=;DRIVER={Microsoft Aess Driver (.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
On Error Resume Next
conn.open connstr
%>
<html>
<head>
<title>管理软件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000" >
<table width=700 border="0" cellspacing="0" cellpadding="0" align="center"><%
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 "<p align=center class=font>暂无软件</p>"
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<totalPut then
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%>
<tr>
<td><%dim pi,vname,vnclass
pi=rs("pic")
vname=rs("name")
vnclass=rs("nclass")%><%
sql="update Special set pic='"&pi&"' where name='"&vname&"' and nclass='"&vnclass&"' "
conn.execute sql
%></td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="21" bgcolor="#F7F7F7" align="center">
<%
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 "<a href="&filename&"?page=1>首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write ""
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
end if
response.write " 页次</font><b><font color=red>"&CurrentPage&"</font>/"&n&"</b>页</font> "
response.write " 共<b>"&totalnumber-1&"</b>个软件 <b>"&maxperpage&"</b>个软件/页"
end function
%>
</td>
</tr>
</table>
</body>
</html>
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程