Problem with field updating using ADO Recordset

Results 1 to 2 of 2

Thread: Problem with field updating using ADO Recordset

  1. #1
    Martin Goodall Guest

    Default Problem with field updating using ADO Recordset

    Help, I am having problems with updating a single record in a recordset. The development database I am using is MS Access 2000. I am trying to insert the contents of variable ‘rolling_increment’ into the numeric field ‘number’ in the table ‘rolling_number’. <BR><BR>Here is the code:<BR><BR>objRS.Open "SELECT * FROM rolling_number WHERE rolling_ID = 1", objConn, , , adCmdText<BR> objRS("number") = rolling_increment<BR> objRS.Update<BR> <BR> ObjRS.Close : objConn.Close<BR><BR>However, when this page (confirm.asp) is called the page crashes with the error message below. Am I missing something obvious ? From the message below it would seem that my problem is a simple syntax error –but is this disguising a problem that is elsewhere in the code ? Any help would be much appreciated.<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR>[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. <BR>/librarian/confirm.asp, line 45<BR>

  2. #2
    David Moran Guest

    Default RE: Problem with field updating using ADO Recordse

    use sql for updates; it&#039;s quicker. Try this:<BR><BR>strSQL = "UPDATE rolling_number set rolling_number.number=" _<BR>& rolling_increment & " WHERE rolling_number.rolling_id=1"<BR>set objrs = objcon.execute(strSQL)<BR>objrs.close<BR>set orjrs=nothing<BR>con.close<BR>set con=nothing<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