Print Page | Close Window

Solution for Errors 80004005 with mySQL

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz NewsPad
Forum Description: Support forum for the Web Wiz NewsPad application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27003
Printed Date: 28 March 2026 at 11:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Solution for Errors 80004005 with mySQL
Posted By: jack24
Subject: Solution for Errors 80004005 with mySQL
Date Posted: 17 February 2009 at 10:16pm
Some places are presenting errors like
read_stats_update.asp (not update read count)

[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



Replies:
Posted By: WebWiz-Bruce
Date Posted: 18 February 2009 at 8:58am
This can also be fixed when using myODBC 3.51.24 and above by changing the following CursorType from 3 to 0:-

rsCommon.CursorType = 0


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net