批量復(fù)制數(shù)據(jù)
更新時(shí)間:2006年11月20日 00:00:00 作者:
現(xiàn)有表Special和表view數(shù)據(jù)結(jié)構(gòu)相同的兩個(gè)表:
Special
Specialid NClass name pic
1 黎明 火舞艷陽(yáng)
2 張學(xué)友 地久天長(zhǎng)
3 陳冠希 同名專(zhuān)輯
4 郭富城 聽(tīng)風(fēng)的歌
view
Specialid NClass name pic
1 黎明 火舞艷陽(yáng) photo/200606192321.jpg
2 張學(xué)友 地久天長(zhǎng) photo/200606192327.jpg
3 劉德華 如果有一天 photo/200606192328.jpg
4 郭富城 聽(tīng)風(fēng)的歌 photo/200606192329.jpg
要將VIEW中的PIC數(shù)據(jù)批量復(fù)制到Special中,(歌手名與專(zhuān)輯要完全相同),代碼如下:
復(fù)制代碼 代碼如下:
Special
Specialid NClass name pic
1 黎明 火舞艷陽(yáng)
2 張學(xué)友 地久天長(zhǎng)
3 陳冠希 同名專(zhuān)輯
4 郭富城 聽(tīng)風(fēng)的歌
view
Specialid NClass name pic
1 黎明 火舞艷陽(yáng) photo/200606192321.jpg
2 張學(xué)友 地久天長(zhǎng) photo/200606192327.jpg
3 劉德華 如果有一天 photo/200606192328.jpg
4 郭富城 聽(tīng)風(fēng)的歌 photo/200606192329.jpg
要將VIEW中的PIC數(shù)據(jù)批量復(fù)制到Special中,(歌手名與專(zhuān)輯要完全相同),代碼如下:
復(fù)制代碼 代碼如下:
<%
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
%>
<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>暫無(wú)軟件</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>
<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>首頁(yè)</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一頁(yè)</a> "
end if
if n-currentpage<1 then
response.write ""
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一頁(yè)</a> <a href="&filename&"?page="&n&">尾頁(yè)</a>"
end if
response.write " 頁(yè)次:</font><b><font color=red>"&CurrentPage&"</font>/"&n&"</b>頁(yè)</font> "
response.write " 共<b>"&totalnumber-1&"</b>個(gè)軟件 <b>"&maxperpage&"</b>個(gè)軟件/頁(yè)"
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 Access 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>暫無(wú)軟件</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>
<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>首頁(yè)</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一頁(yè)</a> "
end if
if n-currentpage<1 then
response.write ""
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一頁(yè)</a> <a href="&filename&"?page="&n&">尾頁(yè)</a>"
end if
response.write " 頁(yè)次:</font><b><font color=red>"&CurrentPage&"</font>/"&n&"</b>頁(yè)</font> "
response.write " 共<b>"&totalnumber-1&"</b>個(gè)軟件 <b>"&maxperpage&"</b>個(gè)軟件/頁(yè)"
end function
%>
</td>
</tr>
</table>
</body>
</html>
相關(guān)文章
Microsoft VBScript 編譯器錯(cuò)誤 錯(cuò)誤 ''800a03e9'' 內(nèi)存不夠的解決方法
今天訪問(wèn)后臺(tái)的時(shí)候提示Microsoft VBScript 編譯器錯(cuò)誤 錯(cuò)誤 '800a03e9' 內(nèi)存不夠,通過(guò)下面的方法簡(jiǎn)單修復(fù)了下,特分享下,方便需要的朋友2015-07-07
如何在ASP頁(yè)面動(dòng)態(tài)Inclue文件?
如何在ASP頁(yè)面動(dòng)態(tài)Inclue文件?...2006-12-12
asp獲取當(dāng)前完整路徑(url)的函數(shù)代碼
這篇文章主要介紹了asp獲取當(dāng)前完整路徑(url)的函數(shù)代碼,有時(shí)候我么您需要獲取網(wǎng)址,端口、路徑文件名、參數(shù)等,這里就為大家分享一下這個(gè)函數(shù)代碼,需要的朋友可以參考下2020-02-02
asp中通過(guò)fso讀取和生成UTF-8編碼的txt
利用fso.OpenTextFil讀取UTF-8文件或者用FSO.save生成UTF-8文件時(shí)亂碼解決辦法生成靜態(tài)頁(yè)使用的方法是讀取asp頁(yè)面的html代碼,保存為html文件,這種方法2013-08-08
ASP中實(shí)現(xiàn)字符部位類(lèi)似.NET里String對(duì)象的PadLeft和PadRight函數(shù)
論壇里又有人問(wèn)起日期怎樣格式化為:2004-08-09 05:02:20這樣的格式:于是寫(xiě)了一個(gè)左(右)對(duì)齊的函數(shù).這函數(shù)等價(jià)于.NET里String對(duì)象的PadLeft和PadRight函數(shù)2020-04-04
asp中常用的字符串安全處理函數(shù)集合(過(guò)濾特殊字符等)
在asp編寫(xiě)中,我們需要注意特殊字符串的處理,防止被黑客利用。使用asp的朋友一定要參考下。2011-01-01

