title: ASP Unterminated string constant error
body: <p>I am receiving the following error and I don't understand how to fix it.</p>
  
  <p>The error:</p>
  
  <pre><code>Microsoft VBScript compilation error '800a0409'
  
  Unterminated string constant
  
  /junk/airsearch/search.htm, line 118
  
  response.write("
  ----------------^
  </code></pre>
  
  <p>ASP code responsible: </p>
  
  <pre><code>  &lt;% if con("notes") = "" then
    response.write("")
    else
    response.write("
    &lt;tr&gt;
      &lt;td colspan='8'&gt;&lt;strong&gt;Notes:&lt;/strong&gt; con('notes')&lt;/td&gt;
    &lt;/tr&gt;")
    endif
    %&gt;
  </code></pre>
  
  <p>Entire page code:</p>
  
  <pre><code>&lt;%@CODEPAGE=65001%&gt; 
  &lt;%
  pagetitle="Aircraft and Simulator Multi-use List 06/074"
  %&gt;
  &lt;!--#INCLUDE VIRTUAL="/_lib/include/header.htm"--&gt;
  &lt;!--#INCLUDE VIRTUAL="/_lib/include/menu.htm"--&gt;
  &lt;script&gt;
  $(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();
  }
  
  });
  &lt;/script&gt;
  &lt;div class="twoColumnRow"&gt;
  &lt;div class="twoColumnContent"&gt;
  &lt;p class="breadCrm"&gt;&lt;a href="/index.htm"&gt;Home&lt;/a&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;a href="/tools/index.htm"&gt;Tools of the Trade&lt;/a&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;a href="/tools/finance/index.htm"&gt;Finance and Purchasing&lt;/a&gt;&lt;span&gt;&amp;gt;&lt;/span&gt; &lt;a href="/tools/finance/procurement/index.htm"&gt;Procurement and Contracts information&lt;/a&gt;&lt;/p&gt;
  &lt;div class="contentPad"&gt;
  &lt;!-- Start of main content --&gt;
  
  &lt;p class="imageRight"&gt;&amp;nbsp;&lt;/p&gt;
  &lt;h1&gt;&lt;%=pagetitle%&gt;&lt;/h1&gt;
  
  &lt;%
          Dim connectString, connect, conDB, sconDB, lDB, con, scon, lcon, src_ccn, src_state
          connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" &amp; 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)
  %&gt;
  &lt;h2&gt;Search results&lt;/h2&gt;
  &lt;% if not con.BOF then %&gt;
  &lt;div style="margin-top:1em"&gt;
  
    &lt;form id="searchf" action="search.htm" method="get"&gt;
  
        &lt;p&gt;Supplier name: &lt;input id="supplier_name" name="supplier_name" type="text" value="&lt;%=src_supplier_name%&gt;"&gt; Aircraft type: &lt;input id="aircraft_type" name="aircraft_type" type="text" value="&lt;%=src_aircraft_type%&gt;"&gt; &lt;/p&gt;
       &lt;p&gt;State or Territory:&lt;br/&gt;
        &lt;select style="width: 497px;" id="state" name="state"&gt;
          &lt;option class="group" label="Any state or territory" value="any" &lt;%if request.querystring("state") = "any" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Australian Capital Territory" value="ACT" &lt;%if request.querystring("state") = "ACT" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="New South Whales" value="NSW" &lt;%if request.querystring("state") = "NSW" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Northern Territory" value="NT" &lt;%if request.querystring("state") = "NT" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Queensland" value="QLD" &lt;%if request.querystring("state") = "QLD" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="South Australia" value="SA" &lt;%if request.querystring("state") = "SA" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Tasmania" value="TAS" &lt;%if request.querystring("state") = "TAS" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Victoria" value="VIC" &lt;%if request.querystring("state") = "VIC" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Western Australia" value="WA" &lt;%if request.querystring("state") = "WA" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Other" value="other" &lt;%if request.querystring("state") = "other" then response.write("selected") %&gt;&gt;&lt;/option&gt;
        &lt;/select&gt;
  
      &lt;input type="submit" value="Search" /&gt;&lt;/p&gt;
    &lt;/form&gt;
    &lt;br /&gt;
  
  &lt;table style="font-size:.9em;" class="contentTable"&gt;
    &lt;tr&gt;
      &lt;th width="25%"&gt;Supplier&lt;/th&gt;
      &lt;th width="5%"&gt;State&lt;/th&gt;
      &lt;th width="20%"&gt;Aircraft type&lt;/th&gt;
      &lt;th width="10%"&gt;Variant&lt;/th&gt;
      &lt;th width="10%"&gt;Hourly cost&lt;/th&gt;
      &lt;th width="10%"&gt;Rental basis&lt;/th&gt;
      &lt;th width="10%"&gt;Timing method&lt;/th&gt;
      &lt;th width="10%"&gt;Insurance excess&lt;/th&gt;
  
    &lt;/tr&gt;
    &lt;% con.Movefirst() %&gt;
    &lt;% while (NOT con.EOF) %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="searchcomp.htm?ccn=&lt;%=con("ccn")%&gt;"&gt;&lt;%=con("supplier_name")%&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("state")%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("aircraft_type")%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("variant")%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("cost_hr")%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("rental_basis")%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("timing_method")%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%=con("insurance_excess")%&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;% if con("notes") = "" then
    response.write("")
    else
    response.write("
    &lt;tr&gt;
      &lt;td colspan='8'&gt;&lt;strong&gt;Notes:&lt;/strong&gt; con('notes')&lt;/td&gt;
    &lt;/tr&gt;")
    endif
    %&gt;
    &lt;%
      con.MoveNext()
      Wend
    %&gt;
  &lt;/table&gt;
  
  &lt;/div&gt;
  &lt;% else %&gt;
      &lt;% scon.Movefirst() %&gt;
    &lt;form id="searchf" action="search.htm" method="get"&gt;
  
        &lt;p&gt;Supplier name: &lt;input id="supplier_name" name="supplier_name" type="text" value="&lt;%=src_supplier_name%&gt;"&gt; Aircraft type: &lt;input id="aircraft_type" name="aircraft_type" type="text" value="&lt;%=src_aircraft_type%&gt;"&gt; &lt;/p&gt;
       &lt;p&gt;State or Territory:&lt;br/&gt;
        &lt;select style="width: 497px;" id="state" name="state"&gt;
          &lt;option class="group" label="Any state or territory" value="any" &lt;%if request.querystring("state") = "any" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Australian Capital Territory" value="ACT" &lt;%if request.querystring("state") = "ACT" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="New South Whales" value="NSW" &lt;%if request.querystring("state") = "NSW" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Northern Territory" value="NT" &lt;%if request.querystring("state") = "NT" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Queensland" value="QLD" &lt;%if request.querystring("state") = "QLD" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="South Australia" value="SA" &lt;%if request.querystring("state") = "SA" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Tasmania" value="TAS" &lt;%if request.querystring("state") = "TAS" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Victoria" value="VIC" &lt;%if request.querystring("state") = "VIC" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Western Australia" value="WA" &lt;%if request.querystring("state") = "WA" then response.write("selected") %&gt;&gt;&lt;/option&gt;
          &lt;option class="group" label="Other" value="other" &lt;%if request.querystring("state") = "other" then response.write("selected") %&gt;&gt;&lt;/option&gt;
        &lt;/select&gt;
      &lt;/p&gt;
      &lt;input type="submit" value="Search" /&gt;
    &lt;/form&gt;
    &lt;br /&gt;&lt;hr /&gt;
  &lt;p&gt;No records match your query.&lt;/p&gt;
  &lt;p&gt;&lt;a href="dbtest.htm"&gt;Return to search page&lt;/a&gt;&lt;/p&gt;
  &lt;%
    end if
    con.close
  %&gt;
  
  
  &lt;!-- End of main content --&gt;
  &lt;/div&gt; &lt;!-- end contentPad div --&gt;
  &lt;/div&gt; &lt;!-- end twocolumncontent div --&gt;
  &lt;div class="twoColumnLinks"&gt;
  
  &lt;!--&lt;div class="relatedLinks"&gt;
  &lt;h3&gt;Related Links&lt;/h3&gt;
  &lt;ul&gt;
  &lt;li&gt;&lt;a href="/index.htm"&gt;Related link 1&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;--&gt; &lt;!-- end relatedlinks div --&gt;
  &lt;!--#INCLUDE VIRTUAL="/_lib/include/quicklinks.htm"--&gt;
  &lt;!--#INCLUDE VIRTUAL="/_lib/include/mylinks.htm"--&gt;
  &lt;/div&gt; &lt;!-- end twocolumnlinks div --&gt;
  &lt;/div&gt; &lt;!-- end twocolumnrow div --&gt;
  &lt;!--#INCLUDE VIRTUAL="/_lib/include/footer.htm"--&gt;
  </code></pre>