Bulk copy Data _ Application Tips

Source: Internet
Author: User
The existing table special the same two tables as the table view data structure:
Copy Code code as follows:

Special
Specialid nclass name pic
1 Dawn Fire Dancing the Sun
2 Zhang Xueyou Forever
3 Edison Chen's namesake album
4 Aaron Kwok listens to the wind song
View
Specialid nclass name pic
1 Dawn Fire Dancing the Sun Photo/200606192321.jpg
2 Alumni Forever Photo/200606192327.jpg
3 Andy Lau if one day photo/200606192328.jpg
4 Aaron Kwok listens to the wind song Photo/200606192329.jpg

To bulk copy the PIC data in view into the special (the singer name and album are identical), the code is as follows:
Copy Code code as follows:
<%
Dim conn
Dim connstr
' On Error Resume Next
Connstr= "dbq=" +server.mappath ("P#1.mdb") + ";D efaultdir=;D river={microsoft Access DRIVER (*.mdb)};"
Set Conn=server.createobject ("ADODB. CONNECTION ")
On Error Resume Next
Conn.Open ConnStr
%>
<title> Management software </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<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> no software </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 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
%></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>
&LT;TD height= "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> home </a>"
Response.Write "<a href=" &filename& "page=" &CurrentPage-1& "> previous page </a>"
End If
If N-currentpage<1 Then
Response.Write ""
Else
Response.Write "<a href=" &filename& "page=" & (currentpage+1) & ">"
Response.Write "Next page </a> <a href=" &filename& "? page=" &n& "> End </a>"
End If
Response.Write "page: </font><b><font color=red>" &CurrentPage& "</font>/" &n& "</b> page </font>"
Response.Write "Total <b>" &totalnumber-1& "</b> software <b>" &maxperpage& "</b> software/page"
End Function
%>
</td>
</tr>
</table>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.