Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch page only works when there is query strings in the url
    text
    copied!<p>I am trying to work out how to make the page work without querystrings in the url, the default page per say.</p> <p>Example:</p> <p>dbinstant.htm?legal=&amp;cat=all == WORKS dbinstant.htm == ERROR as below</p> <pre><code>Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Text Driver] Syntax error (missing operator) in query expression '= 'Yes' AND ucase(legal) LIKE ucase('%%')'. /junk/dbinstant.htm, line 56 </code></pre> <p>PAGE CODE BELOW: </p> <pre><code>&lt;%@ LANGUAGE="VBSCRIPT" %&gt; &lt;% pagetitle="Contractor Details" %&gt; &lt;!--#INCLUDE VIRTUAL="/_lib/include/header.htm"--&gt; &lt;!--#INCLUDE VIRTUAL="/_lib/include/menu.htm"--&gt; &lt;script&gt; $(document).ready(function() { $("#cat").change(function () { this.form.submit(); }) $('#legal').focus() var typingTimer; var doneTypingInterval = 800; $('#legal').keyup(function(){ clearTimeout(typingTimer); if ($('#legal').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_abn, src_cat connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" &amp; Server.MapPath("data") src_legal = Request.QueryString("legal") src_cat = Request.QueryString("cat") set connect = Server.CreateObject("ADODB.connection") connect.open connectString if src_cat = "all" then conDB = "SELECT * FROM cont.csv WHERE ucase(legal) LIKE ucase('%"+src_legal+"%')" lDB = "SELECT * FROM cont.csv WHERE ucase(legal) LIKE ucase('%"+src_legal+"%')" else conDB = " SELECT * FROM cont.csv WHERE " &amp; src_cat &amp; " = 'Yes' AND ucase(legal) LIKE ucase('%"+src_legal+"%')" lDB = " SELECT * FROM cont.csv WHERE " &amp; src_cat &amp; " = 'Yes' AND ucase(legal) LIKE ucase('%"+src_legal+"%')" end if sconDB = "SELECT * FROM cont.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="dbinstant.htm" method="get"&gt; &lt;p&gt;Company name:1&lt;br/&gt; &lt;input id="legal" name="legal" type="text" value="&lt;%=src_legal%&gt;"&gt; &lt;/p&gt; &lt;p&gt;Categories for Creative Design:&lt;br/&gt; &lt;select id="cat" name="cat"&gt; &lt;option class="group" label="All categories" value="all" &lt;%if request.querystring("cat") = "all" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Strategic brand, marketing and communications advice" value="a" &lt;%if request.querystring("cat") = "a" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Graphic design and layout" value="b" &lt;%if request.querystring("cat") = "b" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Forms design" value="c" &lt;%if request.querystring("cat") = "c" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Web design and development" value="d" &lt;%if request.querystring("cat") = "d" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Authoring services" value="e" &lt;%if request.querystring("cat") = "e" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Editorial services" value="f" &lt;%if request.querystring("cat") = "f" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Translation services" value="g" &lt;%if request.querystring("cat") = "g" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Photography and film services" value="h" &lt;%if request.querystring("cat") = "h" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Scanning and digitisation services" value="i" &lt;%if request.querystring("cat") = "i" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Multimedia editing services" value="j" &lt;%if request.querystring("cat") = "j" 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;table style="font-size:.9em;" class="contentTable"&gt; &lt;tr&gt; &lt;th&gt;ABN:&lt;/th&gt; &lt;th&gt;Company Name:&lt;/td&gt; &lt;/tr&gt; &lt;% con.Movefirst() %&gt; &lt;% while (NOT con.EOF) %&gt; &lt;tr&gt; &lt;td width="120px"&gt;&lt;%=con("abn")%&gt;&lt;/th&gt; &lt;td&gt;&lt;a href="dbcomp.htm?abn=&lt;%=con("abn")%&gt;&amp;cat=all"&gt;&lt;%=con("legal")%&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;% con.MoveNext() Wend %&gt; &lt;/table&gt; &lt;/div&gt; &lt;% else %&gt; &lt;% scon.Movefirst() %&gt; &lt;form action="dbinstant.htm" method="get"&gt; &lt;p&gt;Company name:2&lt;br/&gt; &lt;input id="legal" name="legal" type="text"&gt; &lt;/p&gt; &lt;p&gt;Categories for Creative Design:&lt;br/&gt; &lt;select id="cat" name="cat"&gt; &lt;option class="group" label="All categories" value="all" &lt;%if request.querystring("cat") = "all" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Strategic brand, marketing and communications advice" value="a" &lt;%if request.querystring("cat") = "a" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Graphic design and layout" value="b" &lt;%if request.querystring("cat") = "b" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Forms design" value="c" &lt;%if request.querystring("cat") = "c" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Web design and development" value="d" &lt;%if request.querystring("cat") = "d" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Authoring services" value="e" &lt;%if request.querystring("cat") = "e" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Editorial services" value="f" &lt;%if request.querystring("cat") = "f" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Translation services" value="g" &lt;%if request.querystring("cat") = "g" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Photography and film services" value="h" &lt;%if request.querystring("cat") = "h" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Scanning and digitisation services" value="i" &lt;%if request.querystring("cat") = "i" then response.write("selected") %&gt;&gt;&lt;/option&gt; &lt;option class="group" label="Multimedia editing services" value="j" &lt;%if request.querystring("cat") = "j" 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>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload