PDA

View Full Version : data retrievel fom SQL


_JEL_
11-25-2003, 07:21 AM
Ok guys i have the following code to pull data from an SQL table and display it as a scrolling marquee.

<html>



<head>

<link rel="stylesheet" type="text/css" href="teststyle.css" />
<title> Scrolling News </title>
</head>

<body>

<%

Set con = Server.CreateObject("ADODB.Connection")

con.Open "DSN=SQL"

SQL = "SELECT * FROM sorce_news ORDER BY publish_date DESC"

set rs = con.execute (sql)

response.write ("<marquee scrollamount=""1"" scrolldelay=""10"" direction=""up"" width=""300"" height=""300"" loop=""continuous"">")

do while (not rs.eof)

response.write ("<p class=""title"">") & rs("news_title")
response.write ("<p class=""text"">") & rs("news_body")

rs.movenext()
loop

response.write ("</marquee>")


con.close
set con = Nothing


%>

</body>

</html>

the problem is that it will only display the "news_title" records or the "news_body" records but not both.

if if include 2 fileds which have a small amount of data in them e.g. "News_Title" and "ID" then there are no problems.

This leads me to believe that it has something to do with the amount of data that can be stored/displayed.

any ideas guys?

gish
11-25-2003, 09:37 PM
maybe the amount of data for the marquee but the amount of data is not the problem from the db side...I would say the prob is with the amount of data that can go in a marquee....

_JEL_
11-26-2003, 06:15 AM
thanks for the reply

but even if i ditch the marquee and just display the records as a standard page.

i can only show either

news_title or news_body but not both.

i have exported all data into access and used exactly the same code and it all works fine.

any more ideas as i really need to run this from SQL to save on un-necessary replication of data.

_JEL_
11-26-2003, 06:24 AM
problem now solved :)

turns out that it wouldn't let me display the data unless i replaced the line breaks with a
or

tag.