Welcome to WebmasterWorld Guest from 54.167.213.22

Forum Moderators: bill & werty

Message Too Old, No Replies

RSS From Access Database

How do I create an xml RSS feed from an online access database?

     
6:22 pm on Feb 28, 2010 (gmt 0)

5+ Year Member



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.
4:25 am on Mar 1, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
5:46 am on Mar 1, 2010 (gmt 0)

5+ Year Member



bill , is it possible to use an asp file as a feed
6:34 am on Mar 1, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
6:53 am on Mar 1, 2010 (gmt 0)

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
10:36 am on Mar 2, 2010 (gmt 0)

5+ Year Member



<?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>
10:36 am on Mar 2, 2010 (gmt 0)

5+ Year Member



The File should be saved as an asp file
5:58 am on Mar 3, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



No. The file should be saved as XML. You just need to let the server know how to parse the XML file as ASP.
1:08 am on Mar 4, 2010 (gmt 0)

5+ Year Member



feedburner accepts the asp file as input. if it saved as a xml file, how it will fetch data from the server side
1:18 am on Mar 4, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
4:25 am on Mar 4, 2010 (gmt 0)

5+ Year Member



is it mandatory to have the feed as .xml file . can it be .rss file. Still the feeds appear in feedburner
4:55 am on Mar 4, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
5:36 am on Mar 4, 2010 (gmt 0)

5+ Year Member



bill, but do the feed aggregators accept files other than .xml as feeds(if they comply to the specs)
6:06 am on Mar 4, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month