Error 80004005; Updating 1 field in 1 record

Results 1 to 2 of 2

Thread: Error 80004005; Updating 1 field in 1 record

  1. #1
    Join Date
    Dec 1969

    Default Error 80004005; Updating 1 field in 1 record

    Hi,<BR><BR>I am trying to update 1 field in 1 record, and keep getting this error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression <BR><BR>&#039;(EmailID=Pa_RaM001 AND CompanyName=Pa_RaM002 AND ClientSurname=Pa_RaM003 AND ClientTitle=Pa_RaM004 AND ClientEmailAddress=Pa_RaM005 AND ChosenInitiative=Pa_RaM006 AND ChosenActivity=Pa_RaM007 AND ChosenIndustrySector=Pa_RaM008 AND PrimaryConsultants=Pa_RaM00&#039;. <BR><BR><BR>Where EmailID, CompanyName etc are some of my field names!<BR><BR>The relevent part of the code is as follows:<BR>iCookID has already been defined;<BR><BR>objRS.MoveFirst<BR>Do While Not objRS.EOF<BR> iDatabaseID = Cint(objRS("EmailID"))<BR> If iDatabaseID = iCookID then <BR> Dim iReplyCount, iIncrement, iReplyTotal<BR> iReplyCount = Cint(objRS("NoOfReplies"))<BR> iIncrement = 1<BR> iReplyTotal = iReplyCount + iIncrement <BR> objRS("NoOfReplies") = iReplyTotal<BR> objRS.Update<BR> End If<BR>objRS.MoveNext<BR>Loop<BR><BR>This code works fine until it gets to the objRS.Update statement, which is where the error claims to be!<BR>The &#039;NoOfReplies&#039; field is the only field in that recordset which needs updating, and is a numeric field set to integer!<BR><BR>Also, I am using AdLockOptimistic as my Lock Type!<BR>I have been able to write/read to/from this database table, so there is not permission problems!<BR><BR>Any help will be greatly appreciated, as I have found many things on this, but nothing which helps!<BR>Many Thanks, Matt

  2. #2
    Join Date
    Dec 1969

    Default RE: Error 80004005; Updating 1 field in 1 record

    A couple of thoughts:<BR>1) The sql statement listed after the error has some syntax problems: the values are strings & thus need to be surrounded w/ single quotes. <BR><BR>i.e. EmailID=&#039;Pa_RaM001&#039; AND CompanyName=&#039;Pa_RaM002&#039; .... etc<BR><BR>2) The sql where clause is also missing a closing parentheses at the end.<BR><BR>3) But you say the error is raised at the objRS.update line. Are you sure you are updating only one record? That is, is there a unique identifier for each record in objRS? ADO is writing SQL behind the scenes to do the update, and if there is more than 1 rec that matches it will throw an error.<BR><BR>Keep us posted on your progress. Maybe someone else has a few ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts