Forums

ASP

This topic is locked

UPDATE database using ASP

Posted 17 Sep 2003 13:07:56
1
has voted
17 Sep 2003 13:07:56 Sean Johnson posted:
does UPDATE work inthe same way as INSERT? (as in the code below?)

i can only find examples of RS.UPDATE but as my strSQL is quite long, i want to do it in a way similar to my code (bascially i'm not sure how to do it the RS.UPDATE way with all the fields i have!!)



code:
--------------------------------------------------------------------------------

set conn = Server.CreateObject("ADODB.Connection"
conn.Open conn_STRING 'this is set in an include file

strSQL = "UPDATE resource_t SET title_c = '" & strTitle & "' AND firstname_c = '" & strFirstname & "' AND surname_c = '" & strSurname & "' AND address1_c = '" & strAddress1 & "' AND address2_c = '" & strAddress2 & "' AND city_c = '" & strCity & "' AND county_c = '" & strCounty & "' AND postcode_c = '" & strPostcode & "' AND postalarea_c = '" & strPostalarea & "' AND dob_c = '" & strDOB & "' AND gender_c = '" & strGender & "' AND hometel_c = '" & strHometel & "' AND mobiletel_c = '" & strMobiletel & "' AND fpc3_c = " & strFpc3 & " AND cemap_c = " & strCemap & " AND g10_c = " & strG10 & " AND g60_c = " & strG60 & " AND afpc_c = " & strAfpc & " AND otherqual_c = '" & strOtherqual & "' AND cursalary_c = '" & strCursalary & "' AND curdayrate_c = '" & strCurdayrate & "' AND curjobtitle_c = '" & strCurjobtitle & "' AND prevmanexp_c = " & strPrevmanexp & " AND prevreviewexp_c = " & strPrevreviewexp & " AND prevqualass_c = " & strPrevqualass & " AND workaway_c = " & strWorkaway & " WHERE id_c = " & strUid & ""

conn.Execute (strSQL)

conn.Close
set conn = nothing

--------------------------------------------------------------------------------



i just can't get it to update the DB?!?!?!

any help muchly appreicated

thanks

Reply to this topic