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

Software Database: simple 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 PrintSimpleSearchForm 'Close ODBC connection conn.close 'Release memory used by connection set conn = nothing %>

Advanced search

<% Sub PrintSimpleSearchForm 'Prints the search form, ie everything within
tags. 'Only category, level, and target language are listed, this being the simple search '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) %>
<% 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