<%
   ΠFile:      Header.asp
   ΠAuthor:   Marco Tabini
   ΠDate:      February 24, 1998
   ΠRevision:   4
%>
<HTML>
<HEAD>
   <META HTTP-EQUIV=²Content-Type² content=²text/html; 
charset=iso-8859-1²>
   <TITLE><% = Title %> - Web Based DBMS</TITLE>
</HEAD>
<BODY>
<FONT FACE=²Verdana²>
<TABLE WIDTH=100%>
   <TR>
      <TD COLSPAN=2>
         <FONT SIZE=5>
            <B><% = Title %> - Web Based DBMS</B>
         </FONT>
      </TD>
   </TR>
   <TR>
      <TABLE>
         <TR>
            <TD>
               <FONT SIZE=2>
                  <A HREF=²default.asp²>Connect</A>
               </FONT>
            </TD>
         <% if Trim (Session (³Connected²)) = ³True² then %>
            <TD>
               |
            </TD>
            <TD>
               <FONT SIZE=2>
                  <A HREF=²Main.ASP²>Main</A>
               </FONT>
            </TD>
         <% end if %>
         </TR>
      </TABLE>
   </TR>
   <TR>
      <TD COLSPAN=2>
         <HR>
      </TD>
   </TR>
</TABLE>
<P>&nbsp
<%
   REM ‹ Error output function
   Sub CheckForError
      If Err.Number <> 0 Then
         Response.Write (³<FONT SIZE=5><B>ERROR</B></FONT>²)
         Response.Write (³<P>The following error occurred while 
performing the requested operation:²)
         Response.Write (³<P>² & Err.Number & ³&nbsp;² & Err.Description)
         Response.Write (³</BODY></HTML>²)
         Response.End
      End If
   End Sub
   REM ‹ Error-checking wrappers for ADO functions
   Sub SafeMove (NewRow)
      On Error Resume Next
      rs.Move (NewRow)
      CheckForError
   End Sub
   Sub SafeAddNew
      On Error Resume Next
      rs.AddNew
      CheckForError
   End Sub
   Sub SafeUpdate
      On Error Resume Next
      rs.Update
      CheckForError
   End Sub
   Sub SafeMoveNext
      On Error Resume Next
      rs.MoveNext
      CheckForError
   End Sub
   REM ‹ If login information has been given, 
open a connection to the database
   if Trim (Session (³Connected²)) = ³True² then
      On Error Resume Next
      set db = Server.CreateObject (³ADODB.Connection²)
      CheckForError
      db.ConnectionString = ³Driver={SQL Server};server=² & Session 
(³Server²) & ³;DATABASE=² & Session (³Database²) & ³;UID=² & Session 
(³UID²) & ³;PWD=² & Session (³PWD²)
      db.Open
      CheckForError
      REM ‹ Open a recordset if requested by the page
      if Trim (Statement) <> ³² then
         set rs = Server.CreateObject (³ADODB.Recordset²)
         CheckForError
         rs.Open Statement, db, Recordtype, Locktype
         CheckForError
      end if
   end if
%>