%@ Language=VBScript %>
<% Option Explicit %>
Airlines Header
|
|
Select an airline using alphabetical search (i.e. Air Canada - select "A"): |
|
No airlines
<%
Dim MyConnection, MyData, MyDataTemp, MySQL, OneLetter
' Init connection and data object
Set MyConnection = Server.CreateObject("ADODB.Connection")
MyConnection.Open "Data Source=directflightparking_airlines"
Set MyData = Server.CreateObject("ADODB.Recordset")
' Header of the table
Response.Write ""
Response.Write ""
' Loop for all letters
For OneLetter=Asc("A") To Asc("Z")
' Count airlines names which begin on the OneLetter
MySQL="SELECT COUNT(*) AS CountOfAirlines FROM Airlines WHERE AirlineName LIKE '" & Chr(OneLetter) & "%'"
Set MyData = MyConnection.Execute(MySQL)
if MyData("CountOfAirlines")<>0 then
Response.Write "| " & _
"" & _
"" & _
Chr(OneLetter) & " | "
Else
%>
<%= Chr(OneLetter) %>
|
<%
End If
Next
Response.Write "
"
Response.Write "
"
MyData.Close
MyConnection.Close
Set MyData=Nothing
Set MyConnection=Nothing
%>