Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9206907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:16:35+00:00 2026-06-18T00:16:35+00:00

When I want to display a variable I use <%=con(notes)%> but how do I

  • 0

When I want to display a variable I use “<%=con(“notes”)%>” but how do I use that in an if statement? For example:

<% if con("notes") = "" then
  response.write("")
  else
  response.write("<tr><td colspan='8'><strong>Notes:</strong> ") 
  response.write(con("notes"))
  response.write("</td></tr>")
  end if
  %>

Doesn’t seem to work. It doesn’t cause any errors but I know a lot of the notes are empty therefore response.write(“”) should be used a lot in the code.

Anyone got any ideas?

Whole code below:

<%@CODEPAGE=65001%> 
<%
pagetitle="Aircraft and Simulator Multi-use List 06/074"
%>
<!--#INCLUDE VIRTUAL="/_lib/include/header.htm"-->
<!--#INCLUDE VIRTUAL="/_lib/include/menu.htm"-->
<script>
$(document).ready(function() {
    $("#state").change(function () {
    this.form.submit();
})
$('#supplier_name, #aircraft_type').focus()
$("#supplier_name").val($("#supplier_name").val());
$("#aircraft_type").val($("#aircraft_type").val());
var typingTimer;                
var doneTypingInterval = 800;  

$('#supplier_name, #aircraft_type').keyup(function(){
    clearTimeout(typingTimer);
    if ($('#supplier_name, #aircraft_type').val) {
        typingTimer = setTimeout(doneTyping, doneTypingInterval);
    }
});

function doneTyping () {
    $("form").submit();
}

});
</script>
<div class="twoColumnRow">
<div class="twoColumnContent">
<p class="breadCrm"><a href="/index.htm">Home</a> <span>&gt;</span> <a href="/tools/index.htm">Tools of the Trade</a> <span>&gt;</span> <a href="/tools/finance/index.htm">Finance and Purchasing</a><span>&gt;</span> <a href="/tools/finance/procurement/index.htm">Procurement and Contracts information</a></p>
<div class="contentPad">
<!-- Start of main content -->

<p class="imageRight">&nbsp;</p>
<h1><%=pagetitle%></h1>

<%
        Dim connectString, connect, conDB, sconDB, lDB, con, scon, lcon, src_ccn, src_state
        connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" & Server.MapPath("data")
              src_supplier_name = Request.QueryString("supplier_name")
              src_aircraft_type = Request.QueryString("aircraft_type")
              src_state = Request.QueryString("state")
        set connect = Server.CreateObject("ADODB.connection")
        connect.open connectString

        if src_state = "" then
            conDB = "SELECT * FROM mul.csv WHERE ucase(supplier_name) LIKE ucase('%"+src_supplier_name+"%') AND ucase(aircraft_type) LIKE ucase('%"+src_aircraft_type+"%')"   
            lDB = "SELECT * FROM mul.csv WHERE ucase(supplier_name) LIKE ucase('%"+src_supplier_name+"%')" 
        elseif src_state = "any" then
            conDB = "SELECT * FROM mul.csv WHERE ucase(supplier_name) LIKE ucase('%"+src_supplier_name+"%') AND ucase(aircraft_type) LIKE ucase('%"+src_aircraft_type+"%')"   
            lDB = "SELECT * FROM mul.csv WHERE ucase(supplier_name) LIKE ucase('%"+src_supplier_name+"%') AND ucase(aircraft_type) LIKE ucase('%"+src_aircraft_type+"%')" 
        else 
            conDB = " SELECT * FROM mul.csv WHERE ucase(state) LIKE ucase('%"+src_state+"%') AND ucase(supplier_name) LIKE ucase('%"+src_supplier_name+"%') AND ucase(aircraft_type) LIKE ucase('%"+src_aircraft_type+"%')"
            lDB = " SELECT * FROM mul.csv WHERE ucase(state) LIKE ucase('%"+src_state+"%') AND ucase(supplier_name) LIKE ucase('%"+src_supplier_name+"%') AND ucase(aircraft_type) LIKE ucase('%"+src_aircraft_type+"%')"
        end if

        sconDB = "SELECT * FROM mul.csv"    

        set con = connect.execute(conDB)
        set scon = connect.execute(sconDB)
        set lcon = connect.execute(lDB)
%>
<h2>Search results</h2>
<% if not con.BOF then %>
<div style="margin-top:1em">

  <form id="searchf" action="search.htm" method="get">

      <p>Supplier name: <input id="supplier_name" name="supplier_name" type="text" value="<%=src_supplier_name%>"> Aircraft type: <input id="aircraft_type" name="aircraft_type" type="text" value="<%=src_aircraft_type%>"> </p>
     <p>State or Territory:<br/>
      <select style="width: 497px;" id="state" name="state">
        <option class="group" label="Any state or territory" value="any" <%if request.querystring("state") = "any" then response.write("selected") %>></option>
        <option class="group" label="Australian Capital Territory" value="ACT" <%if request.querystring("state") = "ACT" then response.write("selected") %>></option>
        <option class="group" label="New South Whales" value="NSW" <%if request.querystring("state") = "NSW" then response.write("selected") %>></option>
        <option class="group" label="Northern Territory" value="NT" <%if request.querystring("state") = "NT" then response.write("selected") %>></option>
        <option class="group" label="Queensland" value="QLD" <%if request.querystring("state") = "QLD" then response.write("selected") %>></option>
        <option class="group" label="South Australia" value="SA" <%if request.querystring("state") = "SA" then response.write("selected") %>></option>
        <option class="group" label="Tasmania" value="TAS" <%if request.querystring("state") = "TAS" then response.write("selected") %>></option>
        <option class="group" label="Victoria" value="VIC" <%if request.querystring("state") = "VIC" then response.write("selected") %>></option>
        <option class="group" label="Western Australia" value="WA" <%if request.querystring("state") = "WA" then response.write("selected") %>></option>
        <option class="group" label="Other" value="other" <%if request.querystring("state") = "other" then response.write("selected") %>></option>
      </select>

    <input type="submit" value="Search" /></p>
  </form>
  <br />

<table style="font-size:.9em;" class="contentTable">
  <tr>
    <th width="25%">Supplier</th>
    <th width="5%">State</th>
    <th width="20%">Aircraft type</th>
    <th width="10%">Variant</th>
    <th width="10%">Hourly cost</th>
    <th width="10%">Rental basis</th>
    <th width="10%">Timing method</th>
    <th width="10%">Insurance excess</th>

  </tr>
  <% con.Movefirst() %>
  <% while (NOT con.EOF) %>
  <tr>
    <td><a href="searchcomp.htm?ccn=<%=con("ccn")%>"><%=con("supplier_name")%></a></td>
    <td><%=con("state")%></td>
    <td><%=con("aircraft_type")%></td>
    <td><%=con("variant")%></td>
    <td><%=con("cost_hr")%></td>
    <td><%=con("rental_basis")%></td>
    <td><%=con("timing_method")%></td>
    <td><%=con("insurance_excess")%></td>
  </tr>
  <% if con("notes") = "" then
  response.write("")
  else
  response.write("<tr><td colspan='8'><strong>Notes:</strong> ") 
  response.write(con("notes"))
  response.write("</td></tr>")
  end if
  %>
  <%
    con.MoveNext()
    Wend
  %>
</table>

</div>
<% else %>
    <% scon.Movefirst() %>
  <form id="searchf" action="search.htm" method="get">

      <p>Supplier name: <input id="supplier_name" name="supplier_name" type="text" value="<%=src_supplier_name%>"> Aircraft type: <input id="aircraft_type" name="aircraft_type" type="text" value="<%=src_aircraft_type%>"> </p>
     <p>State or Territory:<br/>
      <select style="width: 497px;" id="state" name="state">
        <option class="group" label="Any state or territory" value="any" <%if request.querystring("state") = "any" then response.write("selected") %>></option>
        <option class="group" label="Australian Capital Territory" value="ACT" <%if request.querystring("state") = "ACT" then response.write("selected") %>></option>
        <option class="group" label="New South Whales" value="NSW" <%if request.querystring("state") = "NSW" then response.write("selected") %>></option>
        <option class="group" label="Northern Territory" value="NT" <%if request.querystring("state") = "NT" then response.write("selected") %>></option>
        <option class="group" label="Queensland" value="QLD" <%if request.querystring("state") = "QLD" then response.write("selected") %>></option>
        <option class="group" label="South Australia" value="SA" <%if request.querystring("state") = "SA" then response.write("selected") %>></option>
        <option class="group" label="Tasmania" value="TAS" <%if request.querystring("state") = "TAS" then response.write("selected") %>></option>
        <option class="group" label="Victoria" value="VIC" <%if request.querystring("state") = "VIC" then response.write("selected") %>></option>
        <option class="group" label="Western Australia" value="WA" <%if request.querystring("state") = "WA" then response.write("selected") %>></option>
        <option class="group" label="Other" value="other" <%if request.querystring("state") = "other" then response.write("selected") %>></option>
      </select>
    </p>
    <input type="submit" value="Search" />
  </form>
  <br /><hr />
<p>No records match your query.</p>
<p><a href="dbtest.htm">Return to search page</a></p>
<%
  end if
  con.close
%>


<!-- End of main content -->
</div> <!-- end contentPad div -->
</div> <!-- end twocolumncontent div -->
<div class="twoColumnLinks">

<!--<div class="relatedLinks">
<h3>Related Links</h3>
<ul>
<li><a href="/index.htm">Related link 1</a></li>
</ul>
</div>--> <!-- end relatedlinks div -->
<!--#INCLUDE VIRTUAL="/_lib/include/quicklinks.htm"-->
<!--#INCLUDE VIRTUAL="/_lib/include/mylinks.htm"-->
</div> <!-- end twocolumnlinks div -->
</div> <!-- end twocolumnrow div -->
<!--#INCLUDE VIRTUAL="/_lib/include/footer.htm"-->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:16:36+00:00Added an answer on June 18, 2026 at 12:16 am

    Are you receiving a bunch of table rows with “Notes:”? Sometimes when reading data from the database, I’ve needed to TRIM the results when checking to see if it’s equal to “”:

    if Trim(con("notes") & "") = ""
    

    Alternatively, perhaps the notes field in the database is storing other characters such as line breaks — you should be able to view source to see what’s being printed.

    Hope this helps.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use the sizeToFit method to display a variable amount of text
I want to display the contents of the POST variable, but my output is
I have some user-submitted variables that I want to display in a different part
How do you use a php variable (array) inside a mysql select statement? I
I am building a menu that I want to display in a certain way.
Is it possible to use GTK without a valid X display? I want to
I have a variable , Float64 min; I want to display it only upto
I want to display a map and then 3 text links in a sidebar
In a Django application, I want to display a multi-level (but fixed-depth) tree of
I use custom MVC framework. I want to use annotations above action to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.