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

    When you pass strings in a SQL statement you have to enclose them in single quotes:<BR><BR>(EmailID=&#039;Pa_RaM001&#039; AND CompanyName=&#039;Pa_RaM002&#039; AND ClientSurname=&#039;Pa_RaM003&#039; AND ......<BR><BR><BR><BR>

Posting Permissions

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