[MySQL][ODBC 3.51 Driver][mysqld-5.0.37-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`tblNPNewsletter` SET Email_read=1 WHERE (Email_read=0 )' at line 1
We can resolve this changing the method used for update.
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Newsletter.Email_read " & _
"From " & strDbTable & "Newsletter, " & strDbTable & "NewsCat " & _
"WHERE " & strDbTable & "Newsletter.Newsletter_ID = " & lngNewsletterID & ";"
'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
rsCommon.CursorType = 2
'Set the Lock Type for the records so that the record set is only locked when it is updated
rsCommon.LockType = 3
'Set error trapping
On Error Resume Next
'Query the database
rsCommon.Open strSQL, adoCon
'If an error has occurred write an error to the page
If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "update_newsletter_data", "read_stats_update.asp")
'Disable error trapping
On Error goto 0
'If records returned read them into an array
If NOT rsCommon.EOF Then
'Read in the number of times this newsletter has been read
lngEmailNewsletterRead = CLng(rsCommon("Email_read"))
'Update the recordset
rsCommon.Fields("Email_read") = lngEmailNewsletterRead + 1
'Update the database