• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

Save RSS feed into Access DB

i parse rss feeds from another websites in my asp page... all is well, but is there away to save the rss feed in my access database?
1 Solution
Do you want to save the raw RSS data, or the parsed result?

Saving the raw data is easy, assuming an access database with one table RSSfeeds with an autonumber id field and a text field called rssdata.

<%@ LANGUAGE = VBScript%>
Option Explicit

Dim objConn, objComm, objRS, strSQL, strConnectionString, strRSSData

strRSSData = loadrssfeed("http://www.somesite.com/feed.rss")

strConnectionString = "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("../path/to/mdb") & ";"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnectionString
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = objConn
Set objRS = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT id, rssdata FROM rssfeeds WHERE id=-1"
objComm.CommandText = strSQL
objRS.Open objComm,,0,3
objRS("rssdata") = strRSSData

Set objRS = Nothing
Set objComm = Nothing
Set objConn = Nothing

If you are wanting to store the parsed results, it's the same thing really, but for each article in the feed you'd do an addNew and set objRS("title") = strArticleTitle etc before the update.

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now