Solved

Create RSS-feed From Access Database

Posted on 2009-07-10
35
913 Views
Last Modified: 2013-11-19
i have a access db
ID:
PracticeName:
PCT:
Practice_Telephone_Number:
Contact_Name:
Direct_Line_Number:
Fax_Number:
email_address:
Surgery_Address_including_Postcode:
Brief_description_of_Pratice:
Number_of_Patients:
Number_of_GPs:
Practice_Computer_System:
description_of_Post:
Timestamp:
Remote_computer_name:
User_name:
Browser_type:
Timestamp1:


what is the best way to get top 8 in to a rss feed...... not a asp.net
0
Comment
Question by:James Murrell
  • 17
  • 12
  • 4
  • +1
35 Comments
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24834333
So you're trying to create the RSS XML without using ASP? If you're using PHP is it on a Linux server? If you're using Linux you can get the ODBC drivers to connect to the database here: http://www.openlinksw.com/

If you're using a Windows web server you just need to create the ODBC connection for the PHP to read the Access database and generate the XML for the feed. This page explains how:
http://www.ibm.com/developerworks/library/x-phprss/

Here's an example of the generated XML file:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Your RSS Feed</title>
    <link>http://feedlink.com</link>
    <description>Practices</description>
    <language>en-us</language>
    <pubDate>Tue, 10 Jun 2009 04:00:00 GMT</pubDate>
    <lastBuildDate>Tue, 10 Jun 2009 09:41:01 GMT</lastBuildDate>
  
    <item>
      <title>Practice Name</title>
      <link>http://linkifany.com</link>
      <description>
	 	ID:
		PracticeName:
		PCT:
		Practice_Telephone_Number:
		Contact_Name:
		Direct_Line_Number:
		Fax_Number:
		email_address:
	  </description>
      <pubDate>Tue, 03 Jun 2009 09:39:21 GMT</pubDate>
    </item>
  </channel>
</rss>

Open in new window

0
 
LVL 31

Author Comment

by:James Murrell
ID: 24834379
with asp is ok but not asp.net... it is a windows iis 6 server
0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24834402
I'm not an asp guy but the same format above applies. The article explains how to query the database using ASP and you'll need to write the code that echos out the content of the XML for the feed.

http://www.haneng.com/lessons_17.asp
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 31

Author Comment

by:James Murrell
ID: 24835194
i havew manage to get this far

but nothing appears


<?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>Recent Posts on xxxxxxxxx.com</title>
    <link>http://www.xxxxxxxxxxx.com/</link>
    <description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>
    <language>en-us</language>
    <copyright>Copyright x. 
       All Rights Reserved.</copyright>
    <lastBuildDate><%=Now()%></lastBuildDate>
    <ttl>20</ttl>
<%
  'Dim objConn
 Set objConn = Server.CreateObject("ADODB.Connection")
  'objConn.ConnectionString = Application("practice_registration.mdb")
  objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("practice_registration.mdb") & ";"
 objConn.Open
    
  Dim objRS, strSQL, strDesc 
  strSQL ="SELECT Results.PracticeName, Results.Practice_Telephone_Number, Results.description_of_Post, Results.Timestamp FROM Results;"
  Set objRS = objConn.Execute(strSQL)  
 
  Do While Not objRS.EOF
    strDesc = "<b>Message by " & objRS("PracticeName") & " on " & _
             objRS("Timestamp") & " EST</b><br>" & _
             objRS("description_of_Post").Value %>
    <item>
      <title><%=ApplyXMLFormatting(objRS("PracticeName").Value)%> 
         (<%=ApplyXMLFormatting(objRS("Timestamp").Value)%>)
      </title>
      <link>http://www.xxxxxxx.com/forum/showMessage.asp?F=
           <%=objRS("ForumID")%>&amp;P=1&amp;M=<%=objRS("MsgID")%></link><description><%=ApplyXMLFormatting(strDesc)%></description><datePosted><%=ApplyXMLFormatting(objRS("Timestamp"))%></datePosted></item><%
    objRS.MoveNext
  Loop
  
  objRS.Close
  Set objRS = Nothing
 
  objConn.Close
  Set objRS = Nothing
  Set objConn = Nothing
%></channel></rss>

Open in new window

0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24835208
Are you getting any kind of errors?
0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24835218
Somebody with a heavier background in this should be able to help you from here.
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835229
no errors just  as below and they is 25 records in the db

My Page

RSS content is displayed below:


--------------------------------------------------------------------------------
http://www.xxxxxxxxxxx.com/ xxxxxxx.com is xxxxxxxxx! en-us Copyright 200xxxxxxxx. All Rights Reserved. 12/07/2009 19:26:06 20
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835274
change:
strSQL ="SELECT Results.PracticeName, Results.Practice_Telephone_Number, Results.description_of_Post, Results.Timestamp FROM Results;"


to:
strSQL ="SELECT TOP 8 Results.PracticeName, Results.Practice_Telephone_Number, Results.description_of_Post, Results.Timestamp FROM Results;"
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835290
My Page

RSS content is displayed below:


--------------------------------------------------------------------------------
http://www.xxxxxxxxxxx.com/ xxxxxxx.com is xxxxxxxxx! en-us Copyright 200xxxxxxxx. All Rights Reserved. 12/07/2009 19:42:24 20
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835367
forgot to add : still the same....

0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835446
can you send us a real link to it?  Did you try what I posted to limit them?
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835464
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835493
Try this, exactly how it is posted here (with the exception of adding the forumID, and messageID to your query):


<%
Response.Buffer = true
Response.ContentType = "text/xml"
Write("<rss version=""2.0"">" & VbCrLf)
Write("<channel>" & VBCrLf)
Write("	<title>Recent Posts on xxxxxxxxx.com</title>" & VBCrLf)
Write("	<link>http://www.xxxxxxxxxxx.com/</link>" & VBCrLf)
Write("	<description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>" & VBCrLf)
Write("	<language>en-us</language>" & VBCrLf)
Write("	<copyright>Copyright x. All Rights Reserved.</copyright>" & VBCrLf)
Write("	<lastBuildDate><%=Now()%></lastBuildDate>" & VBCrLf)
Write("	<ttl>20</ttl>" & VBCrLf)
Dim objConn, objRS, strSQL, strDesc
'objConn.ConnectionString = Application("practice_registration.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
	objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("practice_registration.mdb") & ";"
	objConn.Open
		strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp, forumID, messageID FROM Results" 'get the message and forum ID in this...
		Set objRS = objConn.Execute(strSQL) 
			If Not(objRS.Eof) Then
				tmpArr = objRS.GetRows()
			End If
		Set objRS = Nothing 
	objConn.Close
Set objConn = Nothing
If IsArray(tmpArr) Then
	For i = 0 To UBound(tmpArr)
		Write("	<item>" & VbCrLf)
		Write("		<guid isPermaLink=""false"">MESSAGE_" & tmpArr(5, i) & "</guid>" & VbCrLf)
		Write("		<title>" & ApplyXMLFormatting(tmpArr(0, i)) & " (" & ApplyXMLFormatting(tmpArr(3, i)) & ")</title>" & VbCrLf)
		Write("		<link>http://www.xxxxxxx.com/forum/showMessage.asp?F=" & tmpArr(4, i) & "&amp;M=" & tmpArr(5, i) & "</link>" & VbCrLf)
		Write("			<description>" & VbCrLf)
		Write("				<![CDATA[" & VbCrLf)
		Write("					<strong>Message by " & tmpArr(0, i) & " on " & tmpArr(3, i) & " EST</strong><br />" & tmpArr(2, i) & VbCrLf)
		Write("				]]>" & VbCrLf)
		Write("			</description>" & VbCrLf)
		Write("			<pubDate>" & tmpArr(2, i) & "</pubDate>" & VbCrLf)
		Write("	</item>" & VbCrLf)
	Next : i = Null
	Erase tmpArr
End If
Write("</channel>" & VbCrLf)
Function ApplyXMLFormatting(ByVal strInput)
	strInput = Replace(strInput,"&", "&amp;")
	strInput = Replace(strInput,"'", "'")
	strInput = Replace(strInput,"""", "&quot;")
	strInput = Replace(strInput, ">", "&gt;")
	strInput = Replace(strInput,"<","&lt;")
	ApplyXMLFormatting = strInput
End Function   
Sub Write(ByVal strString)
	Response.Write(strString)
End Sub
%>

Open in new window

0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835505
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/RSS2HTML.asp, line 11

Write(" <%=Now()
-------------------------------^
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835507
p.s.   Your first link, is invalid because it is not an XML only document

your second link is not valid because it contains an error:

Invalid use of Null: 'Replace'
/RSS2HTML.asp, line 6

try what I posted, including the changes I suggested
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835511
Ok...change that line to:

Write(" <lastBuildDate>" & Now() & "</lastBuildDate>" & VBCrLf)
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835516
also, I believe it's supposed to be <pubDate></pubDate> and not <lastBuildDate></lastBuildDate>
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835521
aye...   it is... try this:


<%
Response.Buffer = true
Response.ContentType = "text/xml"
Write("<rss version=""2.0"">" & VbCrLf)
Write("<channel>" & VBCrLf)
Write("	<title>Recent Posts on xxxxxxxxx.com</title>" & VBCrLf)
Write("	<link>http://www.xxxxxxxxxxx.com/</link>" & VBCrLf)
Write("	<description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>" & VBCrLf)
Write("	<language>en-us</language>" & VBCrLf)
Write("	<copyright>Copyright x. All Rights Reserved.</copyright>" & VBCrLf)
Write("	<pubDate>" & Now() & "</pubDate>" & VBCrLf)
Write("	<ttl>20</ttl>" & VBCrLf)
Dim objConn, objRS, strSQL, strDesc
'objConn.ConnectionString = Application("practice_registration.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
	objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("practice_registration.mdb") & ";"
	objConn.Open
		strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp, forumID, messageID FROM Results" 'get the message and forum ID in this...
		Set objRS = objConn.Execute(strSQL) 
			If Not(objRS.Eof) Then
				tmpArr = objRS.GetRows()
			End If
		Set objRS = Nothing 
	objConn.Close
Set objConn = Nothing
If IsArray(tmpArr) Then
	For i = 0 To UBound(tmpArr)
		Write("	<item>" & VbCrLf)
		Write("		<guid isPermaLink=""false"">MESSAGE_" & tmpArr(5, i) & "</guid>" & VbCrLf)
		Write("		<title>" & ApplyXMLFormatting(tmpArr(0, i)) & " (" & ApplyXMLFormatting(tmpArr(3, i)) & ")</title>" & VbCrLf)
		Write("		<link>http://www.xxxxxxx.com/forum/showMessage.asp?F=" & tmpArr(4, i) & "&amp;M=" & tmpArr(5, i) & "</link>" & VbCrLf)
		Write("			<description>" & VbCrLf)
		Write("				<![CDATA[" & VbCrLf)
		Write("					<strong>Message by " & tmpArr(0, i) & " on " & tmpArr(3, i) & " EST</strong><br />" & tmpArr(2, i) & VbCrLf)
		Write("				]]>" & VbCrLf)
		Write("			</description>" & VbCrLf)
		Write("			<pubDate>" & tmpArr(2, i) & "</pubDate>" & VbCrLf)
		Write("	</item>" & VbCrLf)
	Next : i = Null
	Erase tmpArr
End If
Write("</channel>" & VbCrLf)
Function ApplyXMLFormatting(ByVal strInput)
	strInput = Replace(strInput,"&", "&amp;")
	strInput = Replace(strInput,"'", "'")
	strInput = Replace(strInput,"""", "&quot;")
	strInput = Replace(strInput, ">", "&gt;")
	strInput = Replace(strInput,"<","&lt;")
	ApplyXMLFormatting = strInput
End Function   
Sub Write(ByVal strString)
	Response.Write(strString)
End Sub
%>

Open in new window

0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835526
using above code

This page contains the following errors:

error on line 10 at column 17: AttValue: " or ' expected
Below is a rendering of the page up to the first error.

Recent Posts on xxxxxxxxx.com http://www.xxxxxxxxxxx.com/ xxx.com is a site wxxxxxxxxxxxxxxs! en-us Copyright x. All Rights Reserved. 12/07/2009 20:40:35 20
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835531
on what link?
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835535
I'm now getting this error on the second link:

No value given for one or more required parameters.

post your code as it is now
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835538
as you posted
<%
Response.Buffer = true
Response.ContentType = "text/xml"
Write("<rss version=""2.0"">" & VbCrLf)
Write("<channel>" & VBCrLf)
Write(" <title>Recent Posts on xxxxxxxxx.com</title>" & VBCrLf)
Write(" <link>http://www.xxxxxxxxxxx.com/</link>" & VBCrLf)
Write(" <description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>" & VBCrLf)
Write(" <language>en-us</language>" & VBCrLf)
Write(" <copyright>Copyright x. All Rights Reserved.</copyright>" & VBCrLf)
Write(" <pubDate>" & Now() & "</pubDate>" & VBCrLf)
Write(" <ttl>20</ttl>" & VBCrLf)
Dim objConn, objRS, strSQL, strDesc
'objConn.ConnectionString = Application("practice_registration.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
        objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("practice_registration.mdb") & ";"
        objConn.Open
                strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp, forumID, messageID FROM Results" 'get the message and forum ID in this...
                Set objRS = objConn.Execute(strSQL) 
                        If Not(objRS.Eof) Then
                                tmpArr = objRS.GetRows()
                        End If
                Set objRS = Nothing 
        objConn.Close
Set objConn = Nothing
If IsArray(tmpArr) Then
        For i = 0 To UBound(tmpArr)
                Write(" <item>" & VbCrLf)
                Write("         <guid isPermaLink=""false"">MESSAGE_" & tmpArr(5, i) & "</guid>" & VbCrLf)
                Write("         <title>" & ApplyXMLFormatting(tmpArr(0, i)) & " (" & ApplyXMLFormatting(tmpArr(3, i)) & ")</title>" & VbCrLf)
                Write("         <link>http://www.xxxxxxx.com/forum/showMessage.asp?F=" & tmpArr(4, i) & "&amp;M=" & tmpArr(5, i) & "</link>" & VbCrLf)
                Write("                 <description>" & VbCrLf)
                Write("                         <![CDATA[" & VbCrLf)
                Write("                                 <strong>Message by " & tmpArr(0, i) & " on " & tmpArr(3, i) & " EST</strong><br />" & tmpArr(2, i) & VbCrLf)
                Write("                         ]]>" & VbCrLf)
                Write("                 </description>" & VbCrLf)
                Write("                 <pubDate>" & tmpArr(2, i) & "</pubDate>" & VbCrLf)
                Write(" </item>" & VbCrLf)
        Next : i = Null
        Erase tmpArr
End If
Write("</channel>" & VbCrLf)
Function ApplyXMLFormatting(ByVal strInput)
        strInput = Replace(strInput,"&", "&amp;")
        strInput = Replace(strInput,"'", "'")
        strInput = Replace(strInput,"""", "&quot;")
        strInput = Replace(strInput, ">", "&gt;")
        strInput = Replace(strInput,"<","&lt;")
        ApplyXMLFormatting = strInput
End Function   
Sub Write(ByVal strString)
        Response.Write(strString)
End Sub
%>

Open in new window

0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835545
Line 18...  did you do as I asked?

strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp, forumID, messageID FROM Results" 'get the message and forum ID in this...



change forumID, and messageID to what they are in the table Results
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835554
post the structure for Resultsis that the structure for the table 'Results' in your main question?
0
 

Expert Comment

by:1500
ID: 24835561
I have no idea what to do here.  I just need to open a QRP file.  I see no help here.

1500
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835562
Try this on for size:


<%
Response.Buffer = true
Response.ContentType = "text/xml"
Write("<rss version=""2.0"">" & VbCrLf)
Write("<channel>" & VBCrLf)
Write("	<title>Recent Posts on xxxxxxxxx.com</title>" & VBCrLf)
Write("	<link>http://www.xxxxxxxxxxx.com/</link>" & VBCrLf)
Write("	<description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>" & VBCrLf)
Write("	<language>en-us</language>" & VBCrLf)
Write("	<copyright>Copyright x. All Rights Reserved.</copyright>" & VBCrLf)
Write("	<pubDate>" & Now() & "</pubDate>" & VBCrLf)
Write("	<ttl>20</ttl>" & VBCrLf)
Dim objConn, objRS, strSQL, strDesc
'objConn.ConnectionString = Application("practice_registration.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
	objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("practice_registration.mdb") & ";"
	objConn.Open
		strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp, ID FROM Results"
		Set objRS = objConn.Execute(strSQL) 
			If Not(objRS.Eof) Then
				tmpArr = objRS.GetRows()
			End If
		Set objRS = Nothing 
	objConn.Close
Set objConn = Nothing
If IsArray(tmpArr) Then
	For i = 0 To UBound(tmpArr)
		Write("	<item>" & VbCrLf)
		Write("		<guid isPermaLink=""false"">MESSAGE_" & tmpArr(5, i) & "</guid>" & VbCrLf)
		Write("		<title>" & ApplyXMLFormatting(tmpArr(0, i)) & " (" & ApplyXMLFormatting(tmpArr(3, i)) & ")</title>" & VbCrLf)
		Write("		<link>http://www.xxxxxxx.com/forum/showMessage.asp?M=" & tmpArr(4, i) & "</link>" & VbCrLf)
		Write("			<description>" & VbCrLf)
		Write("				<![CDATA[" & VbCrLf)
		Write("					<strong>Message by " & tmpArr(0, i) & " on " & tmpArr(3, i) & " EST</strong><br />" & tmpArr(2, i) & VbCrLf)
		Write("				]]>" & VbCrLf)
		Write("			</description>" & VbCrLf)
		Write("			<pubDate>" & tmpArr(2, i) & "</pubDate>" & VbCrLf)
		Write("	</item>" & VbCrLf)
	Next : i = Null
	Erase tmpArr
End If
Write("</channel>" & VbCrLf)
Function ApplyXMLFormatting(ByVal strInput)
	strInput = Replace(strInput,"&", "&amp;")
	strInput = Replace(strInput,"'", "'")
	strInput = Replace(strInput,"""", "&quot;")
	strInput = Replace(strInput, ">", "&gt;")
	strInput = Replace(strInput,"<","&lt;")
	ApplyXMLFormatting = strInput
End Function   
Sub Write(ByVal strString)
	Response.Write(strString)
End Sub
%>

Open in new window

0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835564
@1500....   what?
0
 

Expert Comment

by:1500
ID: 24835569
I recieived an e-mail with a QRP file attached.  How do I open it?
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835571
whoops new code - same error


<%
Response.Buffer = true
Response.ContentType = "text/xml"
Write("<rss version=""2.0"">" & VbCrLf)
Write("<channel>" & VBCrLf)
Write(" <title>Recent Posts on xxxxxxxxx.com</title>" & VBCrLf)
Write(" <link>http://www.xxxxxxxxxxx.com/</link>" & VBCrLf)
Write(" <description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>" & VBCrLf)
Write(" <language>en-us</language>" & VBCrLf)
Write(" <copyright>Copyright x. All Rights Reserved.</copyright>" & VBCrLf)
Write(" <pubDate>" & Now() & "</pubDate>" & VBCrLf)
Write(" <ttl>20</ttl>" & VBCrLf)
Dim objConn, objRS, strSQL, strDesc
'objConn.ConnectionString = Application("practice_registration.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
        objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("practice_registration.mdb") & ";"
        objConn.Open
                strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp,PCT,  ID FROM Results" 'get the message and forum ID in this...
                Set objRS = objConn.Execute(strSQL) 
                        If Not(objRS.Eof) Then
                                tmpArr = objRS.GetRows()
                        End If
                Set objRS = Nothing 
        objConn.Close
Set objConn = Nothing
If IsArray(tmpArr) Then
        For i = 0 To UBound(tmpArr)
                Write(" <item>" & VbCrLf)
                Write("         <guid isPermaLink=""false"">MESSAGE_" & tmpArr(5, i) & "</guid>" & VbCrLf)
                Write("         <title>" & ApplyXMLFormatting(tmpArr(0, i)) & " (" & ApplyXMLFormatting(tmpArr(3, i)) & ")</title>" & VbCrLf)
                Write("         <link>http://www.xxxxxxx.com/forum/showMessage.asp?F=" & tmpArr(4, i) & "&amp;M=" & tmpArr(5, i) & "</link>" & VbCrLf)
                Write("                 <description>" & VbCrLf)
                Write("                         <![CDATA[" & VbCrLf)
                Write("                                 <strong>Message by " & tmpArr(0, i) & " on " & tmpArr(3, i) & " EST</strong><br />" & tmpArr(2, i) & VbCrLf)
                Write("                         ]]>" & VbCrLf)
                Write("                 </description>" & VbCrLf)
                Write("                 <pubDate>" & tmpArr(2, i) & "</pubDate>" & VbCrLf)
                Write(" </item>" & VbCrLf)
        Next : i = Null
        Erase tmpArr
End If
Write("</channel>" & VbCrLf)
Function ApplyXMLFormatting(ByVal strInput)
        strInput = Replace(strInput,"&", "&amp;")
        strInput = Replace(strInput,"'", "'")
        strInput = Replace(strInput,"""", "&quot;")
        strInput = Replace(strInput, ">", "&gt;")
        strInput = Replace(strInput,"<","&lt;")
        ApplyXMLFormatting = strInput
End Function   
Sub Write(ByVal strString)
        Response.Write(strString)
End Sub
%>

Open in new window

ee.txt
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835582
can you upload an example database with some dummy data in it?

@1500...  ask in a new question.  Please do not invade somebody else's question.
0
 
LVL 31

Author Comment

by:James Murrell
ID: 24835606
0
 
LVL 25

Accepted Solution

by:
kevp75 earned 500 total points
ID: 24835984
Ok.

The following code works @: http://manager.zipcm.com/temp.asp

please note...  change the path to your database

<%
Response.Buffer = true
Response.ContentType = "text/xml"
Write("<rss version=""2.0"">" & VbCrLf)
Write("	<channel>" & VBCrLf)
Write("		<title>Recent Posts on xxxxxxxxx.com</title>" & VBCrLf)
Write("		<link>http://www.xxxxxxxxxxx.com/</link>" & VBCrLf)
Write("		<description>xxx.com is a site wxxxxxxxxxxxxxxs!</description>" & VBCrLf)
Write("		<language>en-us</language>" & VBCrLf)
Write("		<copyright>Copyright x. All Rights Reserved.</copyright>" & VBCrLf)
Write("		<pubDate>" & Now() & "</pubDate>" & VBCrLf)
Write("		<ttl>20</ttl>" & VBCrLf)
Dim objConn, objRS, strSQL, strDesc
'objConn.ConnectionString = Application("practice_registration.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
	objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("/practice_registration.mdb") & ";"
	objConn.Open
		strSQL ="SELECT Top 8 PracticeName, Practice_Telephone_Number, description_of_Post, Timestamp, ID, PCT FROM Results"
		Set objRS = objConn.Execute(strSQL) 
			If Not(objRS.Eof) Then
				tmpArr = objRS.GetRows()
			End If
		Set objRS = Nothing 
	objConn.Close
Set objConn = Nothing
If IsArray(tmpArr) Then
	For i = 0 To UBound(tmpArr)
		Write("		<item>" & VbCrLf)
		Write("			<guid isPermaLink=""false"">MESSAGE_" & tmpArr(4, i) & "</guid>" & VbCrLf)
		Write("			<title>" & ApplyXMLFormatting(tmpArr(0, i)) & " (" & ApplyXMLFormatting(tmpArr(3, i)) & ")</title>" & VbCrLf)
		Write("			<link>http://www.xxxxxxx.com/forum/showMessage.asp?M=" & tmpArr(4, i) & "&amp;F=" & ApplyXMLFormatting(tmpArr(5, i)) & "</link>" & VbCrLf)
		Write("			<description>" & VbCrLf)
		Write("				<![CDATA[" & VbCrLf)
		Write("					<strong>Message by " & tmpArr(0, i) & " on " & tmpArr(3, i) & " EST</strong><br />" & tmpArr(2, i) & VbCrLf)
		Write("				]]>" & VbCrLf)
		Write("			</description>" & VbCrLf)
		Write("			<pubDate>" & tmpArr(3, i) & "</pubDate>" & VbCrLf)
		Write("		</item>" & VbCrLf)
	Next : i = Null
	Erase tmpArr
End If
Write("	</channel>" & VbCrLf)
Write("</rss>" & VbCrLf)
Function ApplyXMLFormatting(ByVal strInput)
	If Not(IsNull(strInput)) Then
		ApplyXMLFormatting = Server.HTMLEncode(strInput)
	End If
End Function   
Sub Write(ByVal strString)
	Response.Write(strString)
End Sub
%>

Open in new window

0
 
LVL 25

Expert Comment

by:kevp75
ID: 24835991
also note, there is nothing in the field Timestamp, however Timestamp1 contains a timestamp, so you may want to change the query to reflect this.
0
 
LVL 31

Author Closing Comment

by:James Murrell
ID: 31602320
AAA+++ wish i could give more points - that is great big thanks -
0
 
LVL 25

Expert Comment

by:kevp75
ID: 24843070
glad I could help!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question