I'm trying to put recordsets in a DHTML scroller script. I think I have to change the whole SQL code in order to get this to work. The problem is I want to display 5 recordsets at a time in the scroller. Once the scroller goes through 20 recordsets it returns back to the first 5. I can get it to work with one record set at a time but as I said I want it to work 5 at a time. Can use some help. I got the scroller from DynamicDrive.com "Mikes Scroller"
Here is what I have so far. First take a look at the scroller at http://www.brass-in.com/test_inc_jobs.asp
Now here is what I have as far as code.
<%
Server.ScriptTimeout = 120
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.MaxRecords = 20
' q = "SELECT * FROM jobs ORDER BY dateposted desc"
q = "SELECT TOP 20 * FROM jobs ORDER BY dateposted desc"
rs.Open q, Application("Connection_String")
x = 0
if NOT rs.EOF then
while NOT rs.EOF
if x < 20 then
x = x + 1
recnum = rs("number").value
end if
rs.MoveNext
wend
rs.Close
rs.Open q, Application("Connection_String")
end if
%>
<html>
<head>
<title>Job Search - Matching Jobs</title>
</head>
<body>
<script language="JavaScript" src="dhtmllib.js"></script>
<script language="JavaScript" src="scroller.js"></script>
<script language="JavaScript">
/*
Mike's DHTML scroller (By Mike Hall @ Brainjar.com)
Permission granted to Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
/*
Line 41 sets the properties of the table. Scroller(x layer position, y layer position, width, height, border, padding) *
Line 46 is how you add items to the scroller. Since I am using ASP I only need one line.
*/
var myScroller1 = new Scroller(0, 0, 180, 280, 1, 2);
myScroller1.setColors("#000066", "#EFEFEF", "#EFEFEF");
myScroller1.setFont("Verdana,Arial,Helvetica", 1);
myScroller1.setPause(4000)
myScroller1.setSpeed(100)
myScroller1.addItem("<%For n = 0 to x-1 %><%=n+1 &". "%></B><a href=/aspemployee/matchingjobs.asp?number=<%=rs("number")&">"& rs("title")&"</a></B><BR>" & " " & rs("company")&"<BR>" & " " & rs("city")&", " & rs("state")&"<BR>" &" " & rs("dateposted")&"<BR>" & rs.MoveNext%><%next%><%rs.Close%><%set rs = nothing %>");
function runmikescroll()
{
var layer;
var mikex, mikey;
// Locate placeholder layer so we can use it to position the scrollers.
layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);
// Create the first scroller and position it.
myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}
window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:180px; height:280px;">
</div>
</body>
</html>
'Surround your mind and you shall see a great future ahead'
Shane B.