whats wrong??

Results 1 to 2 of 2

Thread: whats wrong??

  1. #1
    Join Date
    Dec 1969

    Default whats wrong??

    whats wrong with this coding?<BR><BR>If rs.EOF Then<BR>SQL="Insert into faq_research (faq_id) values("&request("id")&")"<BR>rs2.open sql,conn,3,3<BR>SQL="UPDATE faq_research SET "&quantity&"="&quantity&"+1 where faq_id="&Request("id")<BR>rs4.Open conn,3,3<BR>else<BR>SQL="UPDATE faq_research SET "&quantity&"="&quantity&"+1 where faq_id="&Request("id")<BR>rs3.Open sql,conn,3,3<BR>End If

  2. #2
    grinch Guest

    Default RE: whats wrong??

    What is happening? Are you getting an error message and if so, what is it and what line of code is causing it? What is the value of &#039quantity&#039 and of Request("id")? If these values ar missing, you&#039ll get errors, unless you detect that and do something else. Noticed that rs4 doesn&#039t use the SQL string as the 1st parameter, although for an update you should use :<BR>&nbsp&nbspconn.Execute SQL<BR>assuming conn is connected properly, etc.<BR><BR>Here&#039s some debugging tricks that may help. Mostly just want to know the values of the key variables:<BR><BR>If rs.EOF Then<BR>SQL="Insert into faq_research (faq_id) values("&request("id")&")"<BR>&#039---- cut here -------<BR>Response.Write "Sql2:" & sql<BR>Response.Write "&ltbr&gtquantity:" & quantity<BR>Response.End<BR>&#039---- cut here -------<BR>rs2.open sql,conn,3,3<BR>SQL="UPDATE faq_research SET "&quantity&"="&quantity&"+1 where faq_id="&Request("id")<BR>rs4.Open SQL, conn,3,3 &#039&#060;-- added SQL<BR>else<BR>SQL="UPDATE faq_research SET "&quantity&"="&quantity&"+1 where faq_id="&Request("id")<BR>&#039---- cut here -------<BR>Response.Write "Sql5:" & sql<BR>Response.End<BR>&#039---- cut here -------<BR>conn.Execute sql<BR>End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts