I have the update code as below:
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_LL_Data_String
If (CStr(Request("MM_update") <> "" and Request("Doctor_ID" <> "" then
MM_recordId = "" + Request.Form("Doctor_ID" + ""
MM_editCmd.CommandText = "update Doctors set "
MM_editCmd.CommandText = MM_editCmd.CommandText & "Surname= '" & Request("Surname" & "' And Forename = '" & Request("Forename" & "' And Stopped_working= " & Request("Stopped_working" & " And Opinion= '" & Request("Opinion" & "' And Address_1= '" & Request("Address_1" & "' And Address_2= '" & Request("Address_2"& "' And Address_3= '" & Request("Address_3"& "' And Address_4= '" & Request("Address_4"& "' And Postcode= '" & Request("Postcode"& "' And Telephone_number= '" & Request("Telephone_number"& "' And Fax_number= '" & Request("Fax_number"
MM_editCmd.CommandText = MM_editCmd.CommandText & "' where Doctor_ID = " & MM_recordId
All seems fine the record is updated, however the surname is being updated with the Stopped_working value. (this is a checkbox field and so Surname gets value -1).
Help
response.write(MM_editCMD.CommandText)
Else
MM_editCmd.CommandText = "insert into Doctors ( Surname, Forename, Stopped_working, Opinion, Address_1, Address_2, Address_3, Address_4, Postcode, Telephone_number, Fax_number )"
MM_editCmd.CommandText = MM_editCmd.CommandText & " Select '" & Request("Surname" & "', '" & Request("Forename" & "', '" & Request("Stopped_Working" & "', '" & Request("Opinion" & "', '" & Request("Address_1" & "', '" & Request("Address_2" & "', '" & Request("Address_3" & "', '" & Request("Address_4" & "', '" & Request("Postcode" & "', '" & Request("Telephone_number" & "', '" & Request("Fax_number"& "'"
end if
'On Error Resume Next
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_LL_Data_String
If (CStr(Request("MM_update") <> "" and Request("Doctor_ID" <> "" then
MM_recordId = "" + Request.Form("Doctor_ID" + ""
MM_editCmd.CommandText = "update Doctors set "
MM_editCmd.CommandText = MM_editCmd.CommandText & "Surname= '" & Request("Surname" & "' And Forename = '" & Request("Forename" & "' And Stopped_working= " & Request("Stopped_working" & " And Opinion= '" & Request("Opinion" & "' And Address_1= '" & Request("Address_1" & "' And Address_2= '" & Request("Address_2"& "' And Address_3= '" & Request("Address_3"& "' And Address_4= '" & Request("Address_4"& "' And Postcode= '" & Request("Postcode"& "' And Telephone_number= '" & Request("Telephone_number"& "' And Fax_number= '" & Request("Fax_number"
MM_editCmd.CommandText = MM_editCmd.CommandText & "' where Doctor_ID = " & MM_recordId
All seems fine the record is updated, however the surname is being updated with the Stopped_working value. (this is a checkbox field and so Surname gets value -1).
Help
response.write(MM_editCMD.CommandText)
Else
MM_editCmd.CommandText = "insert into Doctors ( Surname, Forename, Stopped_working, Opinion, Address_1, Address_2, Address_3, Address_4, Postcode, Telephone_number, Fax_number )"
MM_editCmd.CommandText = MM_editCmd.CommandText & " Select '" & Request("Surname" & "', '" & Request("Forename" & "', '" & Request("Stopped_Working" & "', '" & Request("Opinion" & "', '" & Request("Address_1" & "', '" & Request("Address_2" & "', '" & Request("Address_3" & "', '" & Request("Address_4" & "', '" & Request("Postcode" & "', '" & Request("Telephone_number" & "', '" & Request("Fax_number"& "'"
end if
'On Error Resume Next