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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with update statement

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have the following statement which produces a syntax error. on the updatesql line. I don't see where my problem is??
<%
updatesql = &quot;UPDATE FamilyInfo SET Address = '&quot; & Request.Form(&quot;Address&quot;) & &quot;', &quot; & &quot;City = '&quot; & Request.Form(&quot;City&quot;) & &quot;', &quot; & &quot;State = '&quot; & Request.Form(&quot;State&quot;) & &quot;', &quot; & &quot;ZipCode = '&quot; & Request.Form(&quot;ZipCode&quot;) & &quot;', &quot; & &quot;E-Mail = '&quot; & Request.Form(&quot;Email&quot;) & &quot;', &quot; & &quot;Phone = '&quot; & Request.Form(&quot;Phone&quot;) & &quot;', &quot; & &quot;CellPhone = '&quot; & Request.Form(&quot;CellPhone&quot;) & &quot;', &quot; & &quot;Fax = '&quot; & Request.Form(&quot;Fax&quot;) & &quot;' &quot; & &quot;WHERE (((FamilyNameID)=&quot; & Request.QueryString(&quot;FamilyNameID&quot;) & &quot;))&quot;

'Sample UPDATE Statement
'UPDATE FamilyInfo SET FamilyInfo.Address = &quot;test&quot;, FamilyInfo.City = &quot;test&quot;, FamilyInfo.State = &quot;test&quot;, FamilyInfo.ZipCode = &quot;test&quot;, FamilyInfo.EMail = &quot;test&quot;, FamilyInfo.CellPhone = &quot;test&quot;, FamilyInfo.Fax = &quot;test&quot;
'WHERE (((FamilyInfo.FamilyNameID)=1));

'Response.write(updatesql)
conn.Execute(updatesql)
%>
 
try this:

Code:
updatesql = &quot;UPDATE FamilyInfo SET Address = '&quot; & Request.Form(&quot;Address&quot;) & &quot;', City = '&quot; & Request.Form(&quot;City&quot;) & &quot;', State = '&quot; & Request.Form(&quot;State&quot;) & &quot;', ZipCode = '&quot; & Request.Form(&quot;ZipCode&quot;) & &quot;', E-Mail = '&quot; & Request.Form(&quot;Email&quot;) & &quot;', Phone = '&quot; & Request.Form(&quot;Phone&quot;) & &quot;', CellPhone = '&quot; & Request.Form(&quot;CellPhone&quot;) & &quot;', Fax = '&quot; & Request.Form(&quot;Fax&quot;) & &quot;' WHERE FamilyNameID = &quot; & Request.QueryString(&quot;FamilyNameID&quot;)

by the way - are the phone,cellphone,fax values stored in your database as numbers or text?? The SQL string above assumes they are text. Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top