homepage Welcome to WebmasterWorld Guest from 54.196.63.93
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
RSS From Access Database
How do I create an xml RSS feed from an online access database?
radermacgk12



 
Msg#: 4088947 posted 6:22 pm on Feb 28, 2010 (gmt 0)

I'm trying to create a xml file that automatically updates with all the entries from my Microsoft Access database. It seems like it should be an easy task, but I don't have much experience with xml at all.

My database is hosted online at www.***.com/fpdb/webeditor3.mdb and I just want to retrieve and display the Title and Description fields for all the items from a table in the database called Results.

Can anyone help me out to what the code to use for this is? Would this file be saved as .xml or .asp or .aspx or what? Also, the server I'm using doesn't support PHP, so any solutions using it wouldn't work.

 

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 4:25 am on Mar 1, 2010 (gmt 0)

Welcome to WebmasterWorld radermacgk12.

It's been a while since I've worked with Access, so I won't give you good specifics on that end. However, you should be able to output data to a file that puts data into an RSS or Atom template. For example, you could use the RSS 2.0 Specification [cyber.law.harvard.edu] as a guideline to make a template for the output file. Then you just need to add the appropriate information fields from your database into the corresponding areas of the template.

dukelips

5+ Year Member



 
Msg#: 4088947 posted 5:46 am on Mar 1, 2010 (gmt 0)

bill , is it possible to use an asp file as a feed

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 6:34 am on Mar 1, 2010 (gmt 0)

It's an XML file being output, but you could use anything from PHP to ASP to create the file, as long as the final format is correct.

mack

WebmasterWorld Administrator mack us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 6:53 am on Mar 1, 2010 (gmt 0)

I can't comment to much on asp specificaly, but you can use almost any server side scripting language to create an xml file. I have done this in the past using php. What I did was create a file called feed.xml this file was in fact a php file with an xml file extension. I was then able to set up the server so that xml was handled in the same way php would be.

When a request was made for feed.xml the php file did its stuff, queried the database and created the output. To the browser or application that was requesting feed.xml they just saw xml output. If you set up your script to create xml style output, and have an xml extenson to the end user/applicaion it will be as good as a true xml file.

Mack.

dukelips

5+ Year Member



 
Msg#: 4088947 posted 10:36 am on Mar 2, 2010 (gmt 0)

<?xml version="1.0" encoding="ISO-8859-1"?>
<% Response.Buffer = true
Response.ContentType = "text/xml"



Function ApplyXMLFormatting(strInput)
strInput = Replace(strInput,"&", "&amp;")
strInput = Replace(strInput,"'", "'")
strInput = Replace(strInput,"""", "&quot;")
strInput = Replace(strInput, ">", "&gt;")
strInput = Replace(strInput,"<","&lt;")

ApplyXMLFormatting = strInput
End Function
%>

<rss version="2.0">
<channel>
<title></title>
<link></link>
<description></description>
<language>en-us</language>
<copyright>All Rights Reserved.</copyright>
<lastBuildDate><%=Now()%></lastBuildDate>
<ttl>20</ttl>
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = Application("forum_system_dsn")
objConn.Open

Dim objRS, strSQL, strDesc
strSQL = "sp_GetTop25Posts"
Set objRS = objConn.Execute(strSQL)

Do While Not objRS.EOF
strDesc = "<b>Message by " & objRS("MsgAuthor") & " on " & _
objRS("MsgDate") & " EST</b><br>" & _
objRS("MsgResponse").Value %>
<item>
<title><%=ApplyXMLFormatting(objRS("MsgTitle").Value)%>
(<%=ApplyXMLFormatting(objRS("MsgAuthor").Value)%>)
</title>
<link>http://www.aspmessageboard.com/forum/showMessage.asp?F=
<%=objRS("ForumID")%>&amp;P=1&amp;M=<%=objRS("MsgID")%></link>
<description><%=ApplyXMLFormatting(strDesc)%></description>
<datePosted><%=ApplyXMLFormatting(objRS("MsgDate"))%></datePosted>
</item>
<%
objRS.MoveNext
Loop

objRS.Close
Set objRS = Nothing

objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</channel>
</rss>

dukelips

5+ Year Member



 
Msg#: 4088947 posted 10:36 am on Mar 2, 2010 (gmt 0)

The File should be saved as an asp file

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 5:58 am on Mar 3, 2010 (gmt 0)

No. The file should be saved as XML. You just need to let the server know how to parse the XML file as ASP.

dukelips

5+ Year Member



 
Msg#: 4088947 posted 1:08 am on Mar 4, 2010 (gmt 0)

feedburner accepts the asp file as input. if it saved as a xml file, how it will fetch data from the server side

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 1:18 am on Mar 4, 2010 (gmt 0)

There are ways to get your webserver to parse other pages just as if they were ASP. You just need to configure your server to know that .XML files should be parsed the same way an .ASP page would.

dukelips

5+ Year Member



 
Msg#: 4088947 posted 4:25 am on Mar 4, 2010 (gmt 0)

is it mandatory to have the feed as .xml file . can it be .rss file. Still the feeds appear in feedburner

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 4:55 am on Mar 4, 2010 (gmt 0)

Feedburner is really off-topic to this thread.

If you want to make an RSS feed from an Access database then you would want to output an XML file in the format of the RSS specification linked to above.

dukelips

5+ Year Member



 
Msg#: 4088947 posted 5:36 am on Mar 4, 2010 (gmt 0)

bill, but do the feed aggregators accept files other than .xml as feeds(if they comply to the specs)

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4088947 posted 6:06 am on Mar 4, 2010 (gmt 0)

I'm not sure what you're asking I guess. If the file complied with the XML specs then it would be an XML file.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved