Results 1 to 4 of 4

Thread: Really Simple Yet Wont Work!

  1. #1

    Really Simple Yet Wont Work!

    hey people... am really struggling with this as seems straightforward yet wont work...

    its basically a form, that submits to the same page.

    there is then an IF statement requesting the Form value and then will either do option one or option two from there.

    Code:
    <% 
    
    applicant_treatment = request.Form("applicant_treatment")
    
    %>
    
    <form action="eshot.asp" method="post" name="home_news" id="home_news">
    <select  class="login" style="width: 250px;" name="applicant_treatment" id="applicant_treatment"  onchange="document.home_news.submit()" >
    <option value="na">Please Select </option>
    <%
    sql = "Select applicant_treatment from applicants"
    rs.open sql,,,adopenstatic
    do while not rs.eof
    %>
    <option <% if applicant_treatment = rs("applicant_treatment") then response.Write("selected") end if %> value="<%=rs("applicant_treatment") %>"><%=rs("applicant_treatment") %></option>
    <%
    rs.movenext
    loop
    rs.close 
    %>
              </select>  
              
              <input class="sub"  type="submit"  value="View News Article"/>
    
            </form>
    
    
    
    
    <h1> <em>Send</em> Eshot </h1>
    
    
    
    <div id="task_select">
    <% 
    if applicant_treatment <> "" Then
    sql = "Select * from applicants where applicant_treatment = " & applicant_treatment
    else
    sql = "Select * from applicants"
    End if
    rs.open sql, , , adopenstatic
    %>
    
    
    <% 
    response.Write("<textarea cols='50' rows='15'  name='recipient' id='recipient'>")
    %>
    <%
    do while not rs.eof
    response.Write (rs("applicant_email") & ";")
    rs.movenext
    loop
    rs.close
    %>
    <% 
    response.Write("</textarea> ")
    %>
    </div>
    im basically getting the result
    Code:
    No value given for one or more required parameters. 
     /cms/eshot.asp, line 54
    *applicant treatment is the field from the database and is in text format.

  2. #2
    I don't know ASP, which is what I'm guessing that is, but the error looks like you're not passing all the required arguments for a particular function. Double check all your functions for required arguments.

  3. #3
    Whats with rs.open sql, , , adopenstatic?

    Why all the commas?

  4. #4
    first this
    if applicant_treatment = rs("applicant_treatment") then
    shouldn't this be == ??

    Sorry but asp is a long time ago with me
    and then

    sql = "Select * from applicants where applicant_treatment
    = " & applicant_treatment

    if applicant_treatment is a string as i suspect because off

    if applicant_treatment <> "" Then

    shouldn't this be enclosed in single quotes?
    like:

    sql = "Select * from applicants where applicant_treatment
    = '" & applicant_treatment & "'"

    i hope it helps

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012