Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2004, 08:41 PM
Authorized User
 
Join Date: Jan 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do I merge these two codes?

I have some ASP code and code for a scrolling thing I found. I'd like the scrolling thing to show the records (in the ASP Code) Here are the two codes...

ASP:
<%
Dim adoCon
Dim rsNews
Dim strSQL2
set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/stacygraff/database/mercy.mdb")
Set rsNews = Server.CreateObject("ADODB.Recordset")
strSQL2 = "SELECT tblNews.NewsInfo FROM tblNews;"
rsNews.Open strSQL2, adoCon
Response.Write ("<table border=""1"" cellpadding=""5"">")
Do While Not rsNews.EOF
    Response.Write ("<tr>")
    Response.Write ("<td>")
    Response.Write (rsNews("NewsInfo"))
    Response.Write ("</td>")
    Response.Write ("</tr>")
    Response.Write ("<br><br>")

    rsNews.MoveNext
Loop

Response.Write ("</table>")

rsNews.Close
Set rsNews = Nothing
Set adoCon = Nothing
%>


Javascript: (the code in red is where the records would go...)

<script language="JavaScript1.2">

/*
Fading Scroller- By DynamicDrive.com
For full source code, and usage terms, visit http://www.dynamicdrive.com
This notice MUST stay intact for use
*/

var delay=3000 //set delay between message change (in miliseconds)
var fcontent=new Array()
begintag='' //set opening tag, such as font declarations
fcontent[0]="<b>This is the Mercy School News!</b> There will be a form in the administrative management area that you can fill out and it should appear here.<br>"
fcontent[1]="This is the 2nd bit."
fcontent[2]="And, here is the 3rd bit of news."closetag=''

var fwidth='165px' //set scroller width
var fheight='270px' //set scroller height

var fadescheme=0 //set 0 to fade text color from (white to black), 1 for (black to white)
var fadelinks=1 //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////

var hex=(fadescheme==0)? 255 : 0
var startcolor=(fadescheme==0)? "rgb(255,255,255)" : "rgb(0,0,0)"
var endcolor=(fadescheme==0)? "rgb(0,0,0)" : "rgb(255,255,255)"

var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var faderdelay=0
var index=0

if (DOM2)
faderdelay=2000

//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color=s tartcolor
document.getElementById("fscroller").innerHTML=beg intag+fcontent[index]+closetag
linksobj=document.getElementById("fscroller").getE lementsByTagName("A")
if (fadelinks)
linkcolorchange(linksobj)
colorfade()
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
else if (ns4){
document.fscrollerns.document.fscrollerns_sub.docu ment.write(begintag+fcontent[index]+closetag)
document.fscrollerns.document.fscrollerns_sub.docu ment.close()
}

index++
setTimeout("changecontent()",delay+faderdelay)
}

// colorfade() partially by Marcio Galli for Netscape Communications. ////////////
// Modified by Dynamicdrive.com

frame=20;

function linkcolorchange(obj){
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color="rgb("+hex+","+hex+","+hex+")"
}
}

function colorfade() {
// 20 frames fading process
if(frame>0) {
hex=(fadescheme==0)? hex-12 : hex+12 // increase or decrease color value depd on fadescheme
document.getElementById("fscroller").style.color=" rgb("+hex+","+hex+","+hex+")"; // Set color value.
if (fadelinks)
linkcolorchange(linksobj)
frame--;
setTimeout("colorfade()",20);
}

else{
document.getElementById("fscroller").style.color=e ndcolor;
frame=20;
hex=(fadescheme==0)? 255 : 0
}
}

if (ie4||DOM2)
document.write('<div id="fscroller" style="border:0px solid black;width:'+fwidth+';height:'+fheight+';padding: 2px"></div>')

window.onload=changecontent
</script>


<ilayer id="fscrollerns" width=&{fwidth}; height=&{fheight};><layer id="fscrollerns_sub" width=&{fwidth}; height=&{fheight}; left=0 top=0></layer></ilayer>



 
Old March 22nd, 2004, 04:30 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Cross post. Please see here for any replies: http://p2p.wrox.com/topic.asp?TOPIC_ID=11305

Stacy, can you please not double-post your messages in multiple forums??

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
What these Codes Mean? phungleon Access VBA 1 November 14th, 2006 08:50 AM
Need some more sample codes t.m.sundaram Visual Basic 2005 Basics 0 July 16th, 2006 08:16 AM
Please i need help with one of my codes skoob Java Espanol 1 April 11th, 2005 11:39 AM
Help:needs codes GoGoagg All Other Wrox Books 3 June 30th, 2004 01:24 AM
How do I merge these two codes? stacy Classic ASP Basics 3 April 12th, 2004 03:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.