Updating Recordset using ADO Update Method

Results 1 to 2 of 2

Thread: Updating Recordset using ADO Update Method

  1. #1
    Join Date
    Dec 1969
    Posts
    72

    Default Updating Recordset using ADO Update Method

    Hi! I&#039m having a problem with the ADO update method. I&#039m using rs.update to update records in an Access database. 90% of the time, rs.update will update the record and delete the original record (this is the desired action). Sometimes, however, the record is updated, but the original is not deleted - there are 2 records where there should only be 1. Help please!

  2. #2
    Join Date
    Dec 1969
    Posts
    3

    Default RE: Updating Recordset using ADO Update Method

    Hi Ann, what I do when I use the update method is use the where clause on a unique value to force the update to that unique record, in this case I used doc_num.<BR><BR>last_update = Request.Form("last_update")<BR>doc_num = Request.Form("doc_num")<BR>rppo_remarks = Request.Form("rppo_remarks")<BR><BR>Set Connect = Server.CreateObject("ADODB.Connection")<BR>Connect .Open "PROJDLR"<BR>Set rs = Server.CreateObject("ADODB.Recordset") <BR>sql = "UPDATE DLR"<BR><BR>if (rppo_remarks = "") then<BR> sql = sql & " SET rppo_remarks=NULL,last_update=Now"<BR> <BR>else<BR> sql = sql & " SET rppo_remarks=&#039"&rppo_remarks&"&#039,last_updat e=Now"<BR> <BR>end if<BR>sql = sql & " WHERE doc_num=&#039"&doc_num&"&#039"<BR>rs.Open sql, Connect<BR><BR>&#039RESPONSE.WRITE(SQL&"<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
  •