473,607 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP pulling SQL into RSS

1 New Member
I have created an ASP page that will "on the fly" create an XML feed from my MS SQL database and the contents within a specified table.

The Feed: http://www.rockwood.k1 2.mo.us/news/rss.asp

You won't be able to see the code, b/c it returns xml, so I copied it below.

The Problem:
I can get every value to return from the database except the value that goes into the "Descriptio n" tag in the xml. (Ex: title, link and date all return fine. The Database column called "Summary" is supposed to return into the "descriptio n" tag in the xml, but comes back empty - no error, just empty.)

The column value of "summary" is of datatype "ntext", but so is the "title" column, which returns just fine.

Example database record that it's pulling back:
http://www.rockwood.k1 2.mo.us/news/releases/displayfullstor y.asp?Key=932

In this example, it's pulling back the bold title as "title", the
italicized date as "date" and the story text as the "descriptio n" (which is coming back blank in the xml)

Full ASP code:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <% Response.Buffer = true
  3.    Response.ContentType = "text/xml"
  4.  
  5. Function ApplyXMLFormatting(strInput)
  6.   strInput = Replace(strInput,"&", "&")
  7.   strInput = Replace(strInput,"'", "'")
  8.   strInput = Replace(strInput,"""", """)
  9.   strInput = Replace(strInput, ">", ">")
  10.   strInput = Replace(strInput,"<","<")
  11.  
  12.   ApplyXMLFormatting = strInput
  13. End Function
  14.     %>
  15.  
  16. <rss version="2.0">
  17.   <channel>
  18.     <title>News Releases from Rockwood School District</title>
  19.     <link>www.rockwood.k12.mo.us</link>
  20.     <description>The Rockwood School District is St. Louis County
  21. largest public school system, serving about 22,000 students.As we
  22. pursue our goal to provide a world-class education to all of our
  23. students, we remain committed to continuous improvement and increased
  24. student achievement. </description>
  25.     <language>en-us</language>
  26.     <copyright>Copyright 2006 Christopher Beeson
  27.        All Rights Reserved.</copyright>
  28.  
  29.  <%
  30.  
  31.         Dim strReferrer
  32.         strReferrer = Request.QueryString("strReferrer")
  33.         Dim intPage
  34.         Dim intPageCount
  35.         Dim intRecord
  36.         Dim itest
  37.         Dim Key
  38.  
  39.         'Get current Date for AddNew Form
  40.         Dim CurrentDate
  41.         CurrentDate = Date
  42.  
  43.         'Create and Open Connection Object
  44.         Set objConnection = Server.CreateObject("ADODB.Connection")
  45.  
  46.         ' Open the data source connection
  47.         objConnection.Open "dsn=Releases;uid=Removed;pwd=Removed;"
  48.  
  49.         'Create and Open Recordset Object
  50.         set RsList = Server.CreateObject("ADODB.Recordset")
  51.         RsList.ActiveConnection = objConnection
  52.         RsList.CursorType = adOpenDynamic
  53.         'RsList.LockType = adLockOptimistic
  54.         RsList.Source = "MAIN"
  55.         RsList.Open
  56.  
  57.         If Not rslist.EOF Then
  58.                 Do Until rslist.EOF
  59.  
  60. %>
  61.  
  62.     <item>
  63.  
  64. <title><%=ApplyXMLFormatting(RsList("title").Value)%></title><link>http://www.rockwood.k12.mo.us/news/releases/displayfullstory.asp?Key=<%=RsList("key")%></link><description><%=ApplyXMLFormatting(RsList("summary"))%></description><datePosted><%=ApplyXMLFormatting(RsList("date"))%></datePosted></item><%
  65.                 rslist.MoveNext
  66.                 Loop
  67.                 End IF                          
  68.  
  69. %></channel></rss> 
  70.  
Oct 18 '06 #1
1 2872
iam_clint
1,208 Recognized Expert Top Contributor
change your function to display like this
Expand|Select|Wrap|Line Numbers
  1. Function ApplyXMLFormatting(strInput)
  2.   strInput = Replace(strInput,"&", "&")
  3.   strInput = Replace(strInput,"'", "'")
  4.   strInput = Replace(strInput,"""", """)
  5.   strInput = Replace(strInput, ">", ">")
  6.   strInput = Replace(strInput,"<","<")
  7.   response.write strInput
  8.   response.end
  9.   ApplyXMLFormatting = strInput
  10. End Function
  11. %>
  12.  
now because it ended the response you can see what exactly is happening since your description is calling the formatting function i can only think that this is where your problem is. if you have any more problems let me know.

on title your doing .value on description your not.
Oct 18 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
7035
by: Philip D Heady | last post by:
Ok, as some of you may know I'm an Oracle newbie w/ PHP. I'd rather use MySQL but at the office here we use Oracle and boy do I have alot to learn. I'm starting to hate it after using MySQL!! -------------------------------------------------------------------------- 1) Is there a similar statement using PHP/Oracle functions as below for MySQL? -------------------------------------------------------------------------- while (list...
6
3358
by: LRW | last post by:
I have an automated process which uploads a comma separated spreadsheet (csv) and inserts it into a database: $sql = "LOAD DATA INFILE '".$uploadfile."' INTO TABLE `tbl_tracking` FIELDS TERMINATED BY ','". "OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n'". "( `tr_trackno` , `tr_ordernum` , `tr_shipname` , `tr_shipaddr` , `tr_citystate` , `tr_zip` , `tr_weight` , `tr_method` , `tr_shipdate` )";
4
1968
by: LRW | last post by:
For an e-commerce site, I'm wanting to have it pull 4 random images for the front page from a select list of items from the DB. I can get it to pull randomly and place the images, but I can't figure out how to keep it from potentially repeating images; using the same one more than once. The best I can come up with is the following...which makes duplicates a little less common, but certainly doesn't stop it. I'm wondering what piece of...
3
3387
by: middletree | last post by:
I have a page where I allow the user to select one or more names of employees to send an email to, which is sent automatically when the form is submitted. I have a field called EmailSentTo, and if you sent it to Joe Smith, then it stores the employee's number, 200, which is the PK of the Employee table. And there is, of course, another page which displays all the information from that form I just submitted, so I want to display this new...
1
1971
by: TG | last post by:
I have a problem trying to get a value from textbox 1 and textbox 2. If those two values match the data in the database then it has to return a third corresponding value to a third textbox (or label) after a user clicks a submit button. Basically, I am trying to allow users to enter a value of weight in pounds in textbox 1 and a zip code in textbox 2 then pulling the shipping amount from a courier's database and returning that dollar...
2
1622
by: PuckInLA | last post by:
I have a question. I have some data that I am pulling into a dataset that needs to have each row of data emailed out. I got the email funciton working great but its extracting that data that is becoming the problem. I assume it would be in a loop, and to do that I am guessing something like this: for each item in dataset extact row email rowinfo for next
5
6442
by: Stewart | last post by:
Hi there, I have an Access database, which contains the details of company staff and services. The plan is to extract data from this database onto our forthcoming Intranet (no inserting, updating or deleting at this point). The Intranet itself has been created in ASP.NET, using Microsoft Visual Web Developer 2005. My concern is that we will encounter a slow response when pulling data from this Access database across the network...
20
6519
by: scolivas | last post by:
I have a query that is pulling from a table of 35000+ records But for some reason any records beyond 25999 are not coming thru. The Table is a list employees - and thier assignments - so there are many records with the same employee - thus the 35000+ records. When I pull the query - I get all employees numbered 25841 and below...but the ones that are numbered 26000+ won't show. I can filter for those individually on the table itself, but...
3
4108
by: BobRoyAce | last post by:
I am using Visual Studio 2008 w/ VB.NET. For the database, I am using SQL Server 2005, which is running on a dedicated server box. I am creating a WinForms application for a client. It is run on any of several employees' desktop PCs. Now, they want to be able to "push" some of the data from the SQL Server database up to a database on a website (also SQL Server 2005).
0
8050
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8464
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8130
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8324
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4015
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2464
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.