<%
'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
%>
<% 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.
%>
<%
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