<%@ LANGUAGE = "VBScript" %> <% Option Explicit %>

Software Database: advanced search

<% 'Start ASP scripting 'Declare the one and only global variable, the DB connection DIM conn 'Open ODBC connection with Catalogue Set conn = Server.CreateObject("ADODB.Connection") conn.Open "swdb" 'Print search form by calling subroutine PrintAdvancedSearchForm 'Close ODBC connection conn.close 'Release memory used by connection set conn = nothing %>

Simple search

<% Sub PrintAdvancedSearchForm 'Prints the search form, ie everything within
tags. 'Values in the SELECT objects (list/combo boxes) are derived dynamically 'from the database via the procedure PrintComboBox, other than the Level 'combo box which isn't suitable for this method. 'The LABEL tags are for accessibility, as recommended in the W3C's WAI guidelines. %>
: <% call PrintComboBox("category", "category_num", "name", "CATEGORY", true) %>
<% call PrintComboBox("targetlang", "lang_name", "lang_name", "LANGUAGE", true) %>
<% call PrintComboBox("supplier", "supplier_num", "name", "SUPPLIER", true) %>
<% call PrintComboBox("developer", "supplier_num", "name", "SUPPLIER", true) %>
All   Windows (32-bit)   Windows (16-bit)   Macintosh   MSDOS  
 
<% End Sub %> <% Sub PrintComboBox (objname, valuefield, displayfield, tablename, order) 'Subroutine outputs a combo box on a HTML form, with values supplied 'from the software database via a SQL query. The
tags need to have 'been printed in the calling routine. 'The subroutine only properly works on 'lookup' tables - eg CATEGORY, LANGUAGE - 'whose purpose is simply to provide standard values. ' 'Parameters: ' objname: name of combo box ' valuefield: name of field to provide VALUE attribute in