ASP SQL Syntax

Results 1 to 2 of 2

Thread: ASP SQL Syntax

  1. #1
    Join Date
    Dec 1969

    Default ASP SQL Syntax

    Ok guys, how far off am I here. CHECK is a value in a hidden text field. If it doesn&#039;t have a value - no record exists and INSERT is fine to create new record. If it does... there is already a record and I must use UPDATE.<BR><BR><BR>IF session("CHECK") = "" THEN <BR> <BR>SQLquery = "INSERT INTO Table1 (value1, value2) VALUES (&#039;" & session("value1") & "&#039;, &#039;" & session("value2") & "&#039;)"<BR><BR>ELSE<BR><BR>SQLquery = "UPDATE Table1<BR>SET value1, value2 = "&#039;" & session("value1") & "&#039;","&#039;" & session("value2") & "&#039;"<BR><BR>END IF<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Code doesn't agree with you...

    You said:<BR> CHECK is a value in a hidden text field<BR><BR>but then your code does<BR> IF session("CHECK") = "" THEN <BR><BR>which certinly has nothing to do with *any* form field, hidden or not.<BR><BR>Did you mean to code<BR> If Request("CHECK") = "" Then<BR>????<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