updating a recordset

Results 1 to 4 of 4

Thread: updating a recordset

  1. #1
    Janine Fulton Guest

    Default updating a recordset

    Has anyone had a problem with updating a database with a primary key made up of two fields? The Recordset.Update method does not seem to update the underlying database. Thanks for your help

  2. #2
    unicorn11 Guest

    Default RE: updating a recordset

    Dear madam <BR><BR> please specify what the error or the problem is because then only can we help you get over it

  3. #3
    Janine Fulton Guest

    Default RE: updating a recordset

    I am trying to update a table in my database which contains three fields - loginname, proposalsID and vote. The first two of these fields make up the primary key. The user enters values for each of these fields into textboxes in a form and hits submit.<BR>On submitting the form an ASP script tries to update the database<BR>Recordset.fields("loginname") = Request.Form("loginname")<BR>Recordset.fields("pro posalsID") = Request.Form("proposalsID")<BR>Recordset.fields("v ote") = Request.Form("vote")<BR>Recordset.update<BR><BR>Bu t the underlying database does not get updated. I have another script which is updating personal details by this method and it&#039s working fine - but the only difference is that table in the database has only one primary key so that is why I thought that may be the problem.<BR>

  4. #4
    unicorn11 Guest

    Default RE: updating a recordset

    Well is suggest u use some thing like this <BR><BR> open a recordset that says that goes with the sql <BR> "Select * from tablename where primarykey like (if no then = else like ) &#039" & request.form("thatprimaryfieldfromform")& "&#039;" <BR><BR>and the see if rs is eof then use rs.addnew and insert all things into that fields and the rs.update to finish it other wise if <BR><BR>rs.eof &#060;&#062; true <BR><BR>send the person back saying the please check his data <BR><BR> tell me this helped <BR> unicorn11<BR> webmaster@tripmedia.com

Posting Permissions

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