I've the following code:
When I try to write to the access database I get an error message from my server:
"Current_Recordset_does_not_support_updating._This_may_be_a_limitation_of_the_provider__or_of_the_selected_locktype"
What can be the problem? I've checked and I've write permissions on the server for the database!
Thanks in advance for your help.
João Pinto
Code:
<%
Dim cnnSimple ' ADO connection
Dim rstSimple ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file
Dim MySQL
Dim source
strDBPath = Server.MapPath("db/rssdb.mdb")
Set cnnSimple = Server.CreateObject("ADODB.Connection")
cnnSimple.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
Set rstSimple = Server.CreateObject("ADODB.Recordset")
MySQL = "SELECT * FROM news"
source = "The New York Times"
rstSimple.Open MySQL, cnnSimple,3,3
URLToRSS = "[URL unfurl="true"]http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"[/URL]
MaxNumberOfItems = 50
MainTemplateHeader = "<table>"
MainTemplateFooter = "</table>"
ItemTemplate = "<tr><td><a href=" & """{LINK}""" & ">{TITLE}</a><BR>{DESCRIPTION}</td></tr>"
ErrorMessage = "No news available!"
Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlHttp.Open "Get", URLToRSS, false
xmlHttp.Send()
RSSXML = xmlHttp.ResponseText
Set xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")
xmlDOM.async = false
xmlDOM.LoadXml(RSSXML)
Set xmlHttp = Nothing
Set RSSItems = xmlDOM.getElementsByTagName("item")
Set xmlDOM = Nothing
RSSItemsCount = RSSItems.Length-1
if RSSItemsCount > 0 then
Response.Write MainTemplateHeader
End If
j = -1
For i = 0 To RSSItemsCount
rstSimple.AddNew
Set RSSItem = RSSItems.Item(i)
for each child in RSSItem.childNodes
Select case lcase(child.nodeName)
case "title"
RSStitle = child.text
case "link"
RSSlink = child.text
case "description"
RSSdescription = child.text
case "pubDate"
RSSpubdate = child.text
End Select
rstSimple.Fields("Source") = source
rstSimple.Fields("Headline") = RSSTitle
rstSimple.Fields("Description") = RSSDescription
rstSimple.Fields("Link") = RSSlink
rstSimple.Fields("Date") = RSSpubdate
rstSimple.Update
rstSimple.Close
Set rstSimple = Nothing
next
j = J+1
if J<MaxNumberOfItems then
%>
<img src="/images/arrow.gif" width="14" height="9" align="middle"><a href="<%= RSSlink%>" target="_blank" class="hyperblue" onMouseOver="window.status='More...';return true;" onMouseOut="window.status='';return true;"><%= RSSTitle%></a><br> <div align="justify"><a class="black"><%= RSSDescription%></a></div>
<br class="smallblack"> <% ItemContent = ""
End if
Next
Set cnnSimple = Nothing
cnnSimple.Close
if RSSItemsCount > 0 then
Response.Write MainTemplateFooter
else
Response.Write ErrorMessage
End If %>
When I try to write to the access database I get an error message from my server:
"Current_Recordset_does_not_support_updating._This_may_be_a_limitation_of_the_provider__or_of_the_selected_locktype"
What can be the problem? I've checked and I've write permissions on the server for the database!
Thanks in advance for your help.
João Pinto