<% Dim strDSN : strDSN = Application("DSN") Dim strSQL ' used to Pass the SQL statements Dim rsCal ' used for Calendar of Events Dim flag ' used as a flag for checking the images Dim selYear ' used for storing the selected year Dim selMonth Dim rs ' used for storing the selected month Dim i selYear = request("cmbYear") selMonth = request("cmbMonth") IF selYear = "" THEN selYear = YEAR(NOW()) END IF IF selMonth = "" THEN selMonth = MONTH(NOW()) END IF dim days dim Xdate dim WorkDate WorkDate = selMonth & "/1/" & selYear firstDayofMonth = WeekDay(selMonth&"/1/"&selYear) CalenderMonth = Month(WorkDate) If len(CalenderMonth) <> 2 then CalenderMonth = "0" & CalenderMonth end if CalenderYear = Right((WorkDate),4) 'putting the weekdays in the first cell html = "SMTWTFS" 'Filling the table with the month dates for tablecell = 1 to 42 if WeekDayX = 7 then WeekDayX = 0 end if WeekDayX = WeekDayX + 1 plus = plus + 1 'Not all of the cells are going to be for the current month so we need 'to weed those out and show them as just blank. if plus < FirstDayofMonth then LastMonth = LastMonth + 1 html = html & "  " 'Now we have all of last months days out of the way we can show the current month using the function above to get the correct number of days. elseif thisMonth < DaysInMonth(CalenderMonth, selYear) then thisMonth = thisMonth + 1 '------------------------------------------- 'Database Code Here '------------------------------------------- strDate = selMonth & "/" & thisMonth & "/" & selYear strDate = CDATE(strDate) strSQL = "select [eventid] from events_tbl where eventdateend >= date() and " & _ " eventdatestart<=#" & cdate(strDate) & "# and eventdateend >=#" & cdate(strDate) & "#" Dim cnObj Set cnObj = server.createobject("ADODB.Connection") cnObj.open strDSN Set rsCal = cnObj.Execute(strSQL) IF rsCal.EOF THEN IF thisMonth = DAY(NOW()) THEN if cint(selYear) = cint(year(now())) then if cint(selMonth) = cint(month(now())) then html = html & ""& thisMonth &"" else html = html & ""& thisMonth &"" end if else html = html & ""& thisMonth &"" end if ELSE html = html & ""& thisMonth &"" END IF ELSE IF thisMonth = DAY(NOW()) THEN if cint(selMonth) = cint(month(now())) then if cint(selYear) = cint(year(now())) then html = html & "" & thisMonth & "" else html = html & "" & thisMonth & "" end if else html = html & "" & thisMonth & "" end if ELSE html = html & "" & thisMonth & "" END IF END IF '------------------------------------------- 'Database Code Ends Here '------------------------------------------- 'Once we get to the end of this month we need to know if there are any days left that belong to the next month so we can show them as blank cells in the table. else nextMonth = nextMonth + 1 html = html & "  " if CalenderMonth = 12 then TempMonth = 1 else TempMonth = CalenderMonth + 1 ThisYear = CalenderYear end if nextstart = nextstart + 1 end if 'This is a part of the loop that tells the table to move down to the 'next line if it reaches Saturday (the 7th cell). if tablecell/7 = int(tablecell/7) then html = html & "" end if Next Dim cnObj1 Set cnObj1 = server.createobject("ADODB.Connection") cnObj1.open strDSN strSQL = "Select Top 3 * from Events_tbl" & _ " Where EventDateStart >= #" & CDate(Now) & "#" & _ " Order by EventDateStart ASC" set rs = server.CreateObject("ADODB.Recordset") Set rs = cnObj1.Execute(strSQL) 'The function for formatting all the months in the year, including leap years, so we can display the correct amount of days in the month function DaysInMonth(XDate, XYear) if XDate = 4 or XDate = 6 or XDate = 9 or XDate = 11 then days = 30 elseif XDate = 2 AND XYear/4 = int(XYear/4) then days = 29 elseif XDate = 2 then days = 28 else days = 31 end if DaysInMonth = days end function %> Welcome to Yates County
Business Directories
Holiday Specials!!
Boating & Fishing
Computer Services
Education
Farm Market
Government
Hiking
Insurance
Accommodation
Media
Real Estate
Restaurants
Shopping
Tours
Transportation
Wineries
More >>
 Escape Packages
 Wineries
 Accommodation Availability
Four seasons of family fun await you in Yates County!
<% i = 0 Do while not rs.eof and i < 4 i = i + 1 strEventName = Trim(rs.Fields("EventName").Value ) If Len(strEventName) > 30 Then strEventName = Left(strEventName, 27) & "..." End If %>
<%= strEventName %>
<%=rs("EventDateStart") & ", " & rs("EventLocation") %>
">More >>
<%rs.movenext loop set rs = nothing%>
<%=html%>
events
 


Penn Yan New
York

Forecast!!


Unshackle Upstate

Yates County
Travel Guide


2009
Keuka Wine Trail
Guide!


 
 

I Love NY
Visit the FingerLakes.org website Order a Wine Country Travel Guide

Order a Wine Country Guide!