<HTML>
<HEAD><TITLE>Films</TITLE></HEAD>
<BODY>
<H2>List of Films</H2>

<CFTRY>
  <!--- Retrieve Films and Related Actors from database --->
  <CFQUERY NAME="GetFilmInfo" DATASOURCE="ows">
    SELECT FilmID, MovieTitle
    FROM FilmsThisDoesNotExist
    ORDER BY Films.MovieTitle
  </CFQUERY>

  <!--- If any database errors occur during above query --->
  <CFCATCH TYPE="Database">
    <!--- Construct connection string so we can query Films.txt file --->
    <CFSET Driver = "{MERANT 3.70 ColdFusion OEM 32-BIT TextFile (*.*)}">
    <CFSET DBDir  = GetDirectoryFromPath(GetCurrentTemplatePath())>
    <CFSET ConStr = "DRIVER=#Driver#;DB=#DBDir#;FLN=1;tT=COMMA;UT=GUESS">
  
    <!--- Retrieve Films and Related Actors from database --->
    <CFQUERY NAME="GetFilmInfo" DBTYPE="dynamic" CONNECTSTRING="#ConStr#">
      SELECT FilmID, MovieTitle
      FROM Films.txt
      ORDER BY Films.MovieTitle
    </CFQUERY>

    <!--- Let user know that text file is being used --->
    <I><P>NOTE: 
    We are not able to connect to our real-time database at the moment.<BR>
    Insted, we are displaying information from out most recent archives.<BR>
    Please try again later today for an up to date listing.<BR>&nbsp;<BR></I>  
  </CFCATCH>
</CFTRY>

<!--- Display retrieved information in HTML table --->
<CFTABLE QUERY="GetFilmInfo" HTMLTABLE BORDER COLHEADERS>
  <CFCOL HEADER="Film ID" TEXT="#FilmID#">
  <CFCOL HEADER="Film Title" TEXT="#MovieTitle#">
</CFTABLE>

</BODY>
</HTML>
