Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong value being updated with wrong value

Status
Not open for further replies.

charlesb

IS-IT--Management
Dec 14, 2001
26
0
0
GB
I have the update code as below:

Set MM_editCmd = Server.CreateObject("ADODB.Command")

MM_editCmd.ActiveConnection = MM_LL_Data_String

If (CStr(Request(&quot;MM_update&quot;)) <> &quot;&quot; and Request(&quot;Doctor_ID&quot;) <> &quot;&quot;) then
MM_recordId = &quot;&quot; + Request.Form(&quot;Doctor_ID&quot;) + &quot;&quot;
MM_editCmd.CommandText = &quot;update Doctors set &quot;
MM_editCmd.CommandText = MM_editCmd.CommandText & &quot;Surname= '&quot; & Request(&quot;Surname&quot;) & &quot;' And Forename = '&quot; & Request(&quot;Forename&quot;) & &quot;' And Stopped_working= &quot; & Request(&quot;Stopped_working&quot;) & &quot; And Opinion= '&quot; & Request(&quot;Opinion&quot;) & &quot;' And Address_1= '&quot; & Request(&quot;Address_1&quot;) & &quot;' And Address_2= '&quot; & Request(&quot;Address_2&quot;)& &quot;' And Address_3= '&quot; & Request(&quot;Address_3&quot;)& &quot;' And Address_4= '&quot; & Request(&quot;Address_4&quot;)& &quot;' And Postcode= '&quot; & Request(&quot;Postcode&quot;)& &quot;' And Telephone_number= '&quot; & Request(&quot;Telephone_number&quot;)& &quot;' And Fax_number= '&quot; & Request(&quot;Fax_number&quot;)
MM_editCmd.CommandText = MM_editCmd.CommandText & &quot;' where Doctor_ID = &quot; & 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 = &quot;insert into Doctors ( Surname, Forename, Stopped_working, Opinion, Address_1, Address_2, Address_3, Address_4, Postcode, Telephone_number, Fax_number )&quot;
MM_editCmd.CommandText = MM_editCmd.CommandText & &quot; Select '&quot; & Request(&quot;Surname&quot;) & &quot;', '&quot; & Request(&quot;Forename&quot;) & &quot;', '&quot; & Request(&quot;Stopped_Working&quot;) & &quot;', '&quot; & Request(&quot;Opinion&quot;) & &quot;', '&quot; & Request(&quot;Address_1&quot;) & &quot;', '&quot; & Request(&quot;Address_2&quot;) & &quot;', '&quot; & Request(&quot;Address_3&quot;) & &quot;', '&quot; & Request(&quot;Address_4&quot;) & &quot;', '&quot; & Request(&quot;Postcode&quot;) & &quot;', '&quot; & Request(&quot;Telephone_number&quot;) & &quot;', '&quot; & Request(&quot;Fax_number&quot;)& &quot;'&quot;
end if
'On Error Resume Next
 
I would check the HTML code and see if there are naming errors of input fields. <Dmitriy>
dbrom@crosswinds.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top