Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Solution for Errors 80004005 with mySQL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedSolution for Errors 80004005 with mySQL

 Post Reply Post Reply
Author
jack24 View Drop Down
Newbie
Newbie


Joined: 15 February 2009
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote jack24 Quote  Post ReplyReply Direct Link To This Post Topic: Solution for Errors 80004005 with mySQL
    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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.