I am getting the error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Query-based update failed because the row to update could not be found.
/manage/article_modify2.as
p, line 23
The thing is that I know the row exists (because when I run the resulting query in Mysql it produces a result)- and everything was working before and now it has just started producing this one error. It has happened with other articles in my database too, where I know that the article exists, but after working perfectly for a few days - the database suddenly can't find it anymore. My fix has been to create a new row with the exact same information, and then it works.
Here is the code I am using:
Set MyConn = Server.CreateObject("ADODB
.Connectio
n")
strMyConn = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"Server=xx.xx.xx.xxx;" & _
"Port=3306;" & _
"Option=131072;" & _
"Stmt=;" & _
"Database=xxxx;" & _
"Uid=xxxx;" & _
"Pwd=xxx"
MyConn.Open strMyConn
a = Request.Form("id")
set objRS = Server.CreateObject("ADODB
.Recordset
")
strSQL = "SELECT * FROM tblArticles WHERE ArticleID = " & a
objRS.Open strSQL, MyConn, 2,2
objRS("ArticleDescription"
) = Request.Form("ArticleDescr
iption")
objRS("ArticleContent") = Request.Form("ArticleConte
nt")
objRS("IssueID") = Request.Form("IssueID")
objRS("CategoryID") = Request.Form("CategoryID")
objRS("ArticlePrice") = Request.Form("ArticlePrice
")
objRS("ArticleRating") = Request.Form("ArticleRatin
g")
objRS("ArticleCYRating") = Request.Form("ArticleCYRat
ing")
objRS("ArticleWebsite") = Request.Form("ArticleWebsi
te")
objRS("ArticleTitle") = Request.Form("ArticleTitle
")
objRS.Update()
objRS.Close
set sql = nothing
set objRS=Nothing
Line 23 is the objRS.Update() line. I would appreciate any help you could give me. Thanks.
Start Free Trial