%@ Language=VBScript %>
<% Response.Buffer = True
set session("connection") = Server.CreateObject("ADODB.Connection")
session("connection").Open "Driver={mySQL}; Server=localhost; Port=3306; Option=0; Socket=; Stmt=; Database=themclub_org; Uid=umdmclub; Pwd=BCpSBqcx;"
''get date of two months ago from today (to show news articles no more than 2 months old)
Function CToDate(OrgDate)
Date1=CDate(OrgDate)
Date2=Year(Date1) & "-" & month(Date1)-2 & "-" & Day(Date1)
CToDate=Date2
End Function
'Function CToDate(OrgDate)
'Date1=CDate(OrgDate)
'Date2=month(Date1)-1 & "/" & Day(Date1) & "/" & Year(Date1)
'CToDate=Date2
'End Function
'SQL = "Select * from news where news_date > #"& CToDate(date) & "#"
SQL = "Select DISTINCT sport from news order by sport asc"
Set RsSport = Server.CreateObject("ADODB.Recordset")
''response.write SQL
RsSport.open SQL, session("connection")
Function CropSentence(strText, intLength, strCrop)
Dim intPosition 'As Integer
Dim intMaxLength 'As Integer
Dim strOutput 'As String
'Set the max length to be the desired length minus
'the length of the trailing characters.
intMaxLength = intLength
'Check if the max length is less than or equal to zero.
If intMaxLength <= 0 Then
'Return an empty string.
CropSentence = ""
'Check if the inputted text it is less that the desired length.
ElseIf Len(strText) <= intLength Then
'Return the inputted text
CropSentence = strText
'Crop the sentance
Else
'Remove the end of the text.
strOutput = Left(strText, intLength)
'Get the position of the last space in the text.
intPosition = InStrRev(strOutput, " ")
'Return the cropped sentance
CropSentence = Left(strOutput, intPosition - 1) & strCrop
End If
End Function
%>