Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'open a recordset to hold the booked rooms
'
set rsRoomsBooked= Server.CreateObject("ADODB.Recordset")
'open recordset to browse through rooms
'
Set rsRooms = Server.CreateObject("ADODB.Recordset")
'Path and connection are the same as before so we dont need to define these again
'----- Concate the SQL string for All rooms
'
StrSQL="SELECT TblRooms.Fld_RoomsIndex, TblRooms.Fld_Room FROM TblRooms;"
'----- Perform the query
'
rsRooms.Open strSQL, conn
'move to the first record
'
rsRooms.movefirst
'Start the loop
'
while rsRooms.eof=false
response.write("<tr>")
for Intx=0 to 13 'Start the Inner loop
DteDate= (FormatDateTime((date()+intx),vbshortdate))'Date incrementing day by 1 (American format)
IntDay=mid(DteDate,4,2)
IntMonth=MonthName(left(DteDate,2), True)
IntYear=right(DteDate,2)
'Leaving a blank space allows the cell to word wrap so join the elements
'with a ASCII space
DteDate = IntDay & "/" & IntMonth & "/" & IntYear
VarTemp = VarTemp 'brought over from the first ASP page
StrSql="" 'reset the string
StrSql="SELECT TblBookings.Fld_BookingsIndex, TblBookings.Fld_RoomsIndex, TblBookings.Fld_PeriodIndex, TblBookings.Fld_Dte FROM TblBookings"
StrSql= StrSql & " WHERE (((TblBookings.Fld_RoomsIndex)=" & rsRooms("Fld_RoomsIndex") & ") AND ((TblBookings.Fld_PeriodIndex)=" & VarTemp & ") AND ((TblBookings.Fld_Dte)=#" & DteDate & "#));"
rsRoomsBooked.Open strSQL, conn
if isnull(rsRoomsBooked("Fld_RoomsIndex"))=true then
Strtemp=""""
else
response.write ("<td>" & rsRoomsBooked("Fld_RoomsIndex") & "</td>")
end if
next 'back to the start of the inner loop
response.write ("</tr>")
'move the outside loop on one record
'
rsRooms.movenext
wend 'start the outside loop again
rsRoomsBooked.Open strSQL, conn
Set rsRoomsBooked = conn.Execute(strSql)
if isnull(rsRoomsBooked)=true then
StrTemp= 0
else
StrTemp = rsRoomsBooked("Fld_BookingsIndex")
end if