MartyConnelly
martyconnelly at shaw.ca
Sun Oct 10 16:13:54 CDT 2004
There are a lot of RSS Viewers available on the net
Here is one and some test feeds below
http://www.rssreader.com/
Here is some VBA code to grab an RSS feed and stick the data into an
Access table with one hyperlink field
that can be then displayed on a continuous feed form
'LoadXML "http://msdn.microsoft.com/rss.xml","Just Published"
'LoadXML "http://msdn.microsoft.com/webservices/rss.xml","Web Services"
'LoadXML "http://msdn.microsoft.com/vstudio/rss.xml","Visual Studio"
'LoadXML "http://msdn.microsoft.com/netframework/rss.xml","Net Framework"
'LoadXML "http://msdn.microsoft.com/vcsharp/rss.xml","VC Sharp"
'LoadXML "http://msdn.microsoft.com/visualc/rss.xml", "VisualC"
'LoadXML "http://msdn.microsoft.com/security/rss.xml", "Security"
'Loadxml "http://www.kbalertz.com/rss/acc.xml","accesskbalert"
Public Sub LoadXMLJP(ByRef AdviserXML As String, strFeed As String)
' On Error GoTo ErrorHandler
Const ACTION_NAME As String = "LoadXML"
Dim oDOMDocument As MSXML2.DOMDocument40
Dim oNodeList As IXMLDOMNodeList
Dim oAdviserDetailsNode As IXMLDOMNode
Dim oLowestLevelNode As IXMLDOMElement
Dim objXMLDOMNamedNodeMap As IXMLDOMNamedNodeMap
Dim sTempValue As String
Dim msFPTAdviserID As Object
'temporary database
Dim MyDb As Database
Dim MyRs As Recordset
Dim irec As Long
Dim strTitleLink As String
Set oDOMDocument = New MSXML2.DOMDocument40
oDOMDocument.async = False
oDOMDocument.validateOnParse = False
oDOMDocument.resolveExternals = False
oDOMDocument.preserveWhiteSpace = True
If Not oDOMDocument.Load(AdviserXML) Then
MsgBox Err.number & Err.Description
'Call Err.Raise(ERR_UNABLE_TO_LOAD_ADVISER_XML, ,
ERRDESC_UNABLE_TO_LOAD_ADVISER_XML)
Exit Sub
End If
Debug.Print "grabbed box"
Set oAdviserDetailsNode = oDOMDocument.documentElement
Set objXMLDOMNamedNodeMap = oAdviserDetailsNode.Attributes
'msFPTAdviserID = objXMLDOMNamedNodeMap.getNamedItem("title").nodeValue
Debug.Print "Set"
Debug.Print "msFPT"
Set oNodeList = oAdviserDetailsNode.selectNodes("//item/*")
Set MyDb = CurrentDb
Set MyRs = MyDb.OpenRecordset("RSSFeed")
irec = 0
MyRs.AddNew
For Each oLowestLevelNode In oNodeList
sTempValue = oLowestLevelNode.Text
' Debug.Print oLowestLevelNode.nodeName & "-" & vbCrLf &
oLowestLevelNode.Text
Select Case oLowestLevelNode.nodeName
Case "title"
Debug.Print sTempValue
MyRs!Title = sTempValue
strTitleLink = sTempValue
Case "PubDate"
Debug.Print sTempValue
MyRs!PubDate = sTempValue
Case "description"
Debug.Print sTempValue
MyRs!fdescription = sTempValue
Case "link"
Debug.Print sTempValue
'MyRs!link = sTempValue
'need # format for clickable link
MyRs!link = sTempValue & "#" & sTempValue & "#"
End Select
irec = irec + 1
If irec = 4 Then
'check if duplicate also check if " in string
Debug.Print DLookup("ID", "RSSFeed", "Title=" & Chr(34) &
strTitleLink & Chr(34))
If IsNull(DLookup("Title", "RSSFeed", "Title=" & Chr(34) &
strTitleLink & Chr(34))) Then
MyRs!feed = strFeed
MyRs.Update
End If
MyRs.AddNew
irec = 0
End If
Next
Set MyRs = Nothing
Set MyDb = Nothing
Set oDOMDocument = Nothing
Set oAdviserDetailsNode = Nothing
Set objXMLDOMNamedNodeMap = Nothing
Exit Sub
ErrorHandler:
' Call NewError.Raise(Err.Number, Err.Source, Err.Description,
'MODULE_NAME, ACTION_NAME, Erl)
End Sub
Stuart McLachlan wrote:
>On 9 Oct 2004 at 17:49, Joe Hecht wrote:
>
>
>
>>What is RSS?
>>
>>
>>
>http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html
>
>
>
--
Marty Connelly
Victoria, B.C.
Canada