Beth Johnson Logo Connecting, respecting buyer, seller, builder, community, Earth Advocates Realty

Green Building Events

A calendar of events, classes and seminars of interest to the green building community of North Texas.


<% Dim RecordNumber, RecordID, EnteredBy, EnteredDate, StartListingDate Dim StopListingDate, EventDate, EventTitle, EventDescription Dim FindString, Active, Query, SomethingFound 'open a connection to our database Dim objDB, strPath, objCalendarEntry strPath = "driver={MySQL};server=localhost;uid=akuehne2_beth;pwd=bethslist;database=akuehne2_calendar" set objDB = Server.CreateObject("ADODB.Connection") objDB.Open strPath Set objCalendarEntry = Server.CreateObject("ADODB.Recordset") 'query the database Query = "SELECT * FROM calendar WHERE ( StartListingDate <= '" & ConvertInputDate(Date) & "'" Query = Query & " AND StopListingDate >= '" & ConvertInputDate(Date) & "' ) " Query = Query & "ORDER BY EventDate" Set objCalendarEntry = objDB.Execute(Query) 'display the calendar item SomethingFound = "False" Do While not objCalendarEntry.EOF RecordID = objCalendarEntry("RecordID") EnteredBy = objCalendarEntry("EnteredBy") EnteredDate = objCalendarEntry("EnteredDate") StartListingDate = objCalendarEntry("StartListingDate") StopListingDate = objCalendarEntry("StopListingDate") EventDate = objCalendarEntry("EventDate") EventTitle = objCalendarEntry("EventTitle") EventDescription = objCalendarEntry("EventDescription") Response.Write "

" & EventTitle & "

" EventDescription = AddLinks(EventDescription, "YES", "p10i") EventDescription = Replace(EventDescription,"

","

") Response.Write "

" & EventDescription & "

" objCalendarEntry.MoveNext SomethingFound = "True" Loop 'clean up objDB.Close Set objDB = Nothing if SomethingFound = "False" then Response.Write "

Nothing on the event calendar right now. Check back soon.

" end if Function ConvertInputDate(varDate) DIM ConvertInputDate, DateArray If (Len(Trim(varDate)) > 0) Then DateArray=Split(CStr(varDate),"/") IF Len(Trim(DateArray(0))) < 2 Then DateArray(0) = "0" & DateArray(0) If Len(Trim(DateArray(1))) < 2 Then DateArray(1) = "0" & DateArray(1) If Len(Trim(DateArray(2))) < 4 Then DateArray(2) = "20" & DateArray(2) ConvertInputDate = DateArray(2) & "-" & DateArray(0) & "-" & DateArray(1) End If End Function %>