update checkboxes

Results 1 to 3 of 3

Thread: update checkboxes

  1. #1
    Join Date
    Dec 1969

    Default update checkboxes

    I have checkboxes returning to the page and they are checked if my user has checked the box.<BR><BR>I need to give the administrator the option to check additional boxes and update the record.<BR><BR>my sql statement looks like this <BR>strsql = "UPDATE EquipmentTable SET reqid =&#039;" & requestid & "&#039;"<BR><BR>and I got an error that says <BR>"Violation of PRIMARY KEY constraint &#039;PK_EquipmentTable&#039;. Cannot insert duplicate key in object &#039;EquipmentTable&#039;."<BR><BR>Do I need to change the sql statement or something in the db<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: update checkboxes

    what do you want to update?<BR><BR>you cannot do an update to a primary key (for obvious reasons).<BR><BR>update table<BR>set field=updatedversion<BR>where primarykeycolumn = "& id

  3. #3
    Join Date
    Dec 1969

    Default I think this is what you want...

    Set the value clause of the checkbox to whatever you want to update the fields to...<BR><BR>UPDATE EquipmentTable SET <BR> Field1 = " & Request.Form("CheckBox1"),<BR> Field2 = " & Request.Form("CheckBox2"),<BR> Field3 = " & Request.Form("CheckBox2")<BR> WHERE ReqId = " & RequestId<BR><BR>The error was you were trying to update the primary key...<BR><BR>KLC<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