Recommended: ASP code directly adds and deletes ACCESS tables and fields This example mainly tells how to use Create, Drop and Alter statements to add and delete ACCESS tables and fields. The code is as follows: % '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
In the afternoon, I made an asp+js to achieve the effect of the image rotation. The effect picture is as follows: The image rotation on the left is, I used js, and then I changed it to use asp to achieve the effect.
pic.asp source code:
<%
'Connecting database code saves
sql=(select * from Pic order by picorder asc,id desc)
Set rs=server.CreateObject(adodb.recordset)
If rs.eof And rs.bof Then
%>
document.write('No pictures yet');
<%
Else
%>
var focus_width=820
var focus_height=185
var text_height=0
var swf_height = focus_height+text_height
<%
'Please keep the source when reprinting
Do While Not rs.eof
pics=pics&rs(picurl)&| 'Connect pictures with |
links=links&rs(picaddress)&|
rs.movenext
Loop
picLen=Len(pics)
pics=Left(pics,(picLen-1)) 'The function is to remove the last one|
linksLen=Len(links)
links=Left(links,(linksLen-1))
%>
var pics='<%=pics%>'
var links='<%=links%>'
var texts=''
document.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 width='+ focus_width +' height='+ swf_height +'>');
document.write('<param name=allowScriptAccess value=sameDomain><param name=movie value=flash/pixviewer.swf><param name=quality value=high><param name=bgcolor value=#ffffff>');
document.write('<param name=menu value=false><param name=wmode value=opaque>');
document.write('<param name=FlashVars value=pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&texttheight='+text_height+'>');
document.write('<embed src=flash/pixviewer.swf wmode=opaque FlashVars=pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&texttheight='+text_height+' menu=false bgcolor=#ffffff quality=high width='+ focus_width+' height='+ focus_height+' allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />'); document.write('</object>');
<%End If %>
Then in the place where the home page is called, <script type=text/javascript src=pic.asp></script>
pixviewer.swf can be downloaded at /flash/pixviewer.swf.
Author: Wurong Source:
Share: ASP tips: rs.getrows method GetRows() method is to copy data from Recordset to a two-dimensional array. This is a two-dimensional array. The first subscript marks the field and the second marks the record number. So rsArray = rs.GetRows() rsArray(0, 0) means the first field value of the first row of the record set rsArray(1, 0) means the data of the second field value array in the first row of the record set is guaranteed.