Sorry, I ment to include that. The code is part of a classroom reservation system. This particular portion is designed to check to see if the classroom is available on the day and time specified.
Here is the code. The type mismatch is on line 243
155 Set reserve=Server.CreateObject("ADODB.Recordset")
156 reserve.open "SELECT * FROM reserve WHERE ref=" & id & "", "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:/users/ClassRmCal/classrooms.mdb"
157
158 <!-- " -->
159 Do WHILE NOT reserve.EOF
160
161 out=reserve("ADate")
162 ind=reserve("BDate")
163
164 ttime=reserve("thetime")
165
166 dbperiod = DateDiff("y", out, ind)
167
168
169 if dbperiod=0 then
170
171 interval=DateDiff("y", out, ADate)
172
173 if interval=0 then
174 If thetime="Day" THEN
175 available="no"
176 Exit Do
177 End If
178 If ttime="Day" THEN
179 available="no"
180 Exit Do
181 End If
182 If thetime=ttime THEN
183 REM response.write("x= " & x & "resp= " & resp & thetime & " " & ttime)
184 available="no"
185 Exit Do
186 End If
187
188 Else
189 available="yes"
190
191 end if
192
193 end if
194
195 if dbperiod=1 then
196
197 interval=DateDiff("y", out, ADate)
198
199 if interval=0 then
200 If thetime="Day" THEN
201 available="no"
202 Exit Do
203 End If
204 If ttime="Day" THEN
205 available="no"
206 Exit Do
207 End If
208 If thetime=ttime THEN
209 REM response.write("x= " & x & "resp= " & resp & thetime & " " & ttime)
210 available="no"
211 Exit Do
212 End If
213
214 Else
215 available="yes"
216
217 end if
218
219 interval=DateDiff("y", out, BDate)
220 if interval=0 then
221 If thetime="Day" THEN
222 available="no"
223 Exit Do
224 End If
225 If ttime="Day" THEN
226 available="no"
227 Exit Do
228 End If
229 If thetime=ttime THEN
230 REM response.write("x= " & x & "resp= " & resp & thetime & " " & ttime)
231 available="no"
232 Exit Do
233 End If
234
235 Else
236 available="yes"
237
238 end if
239
240 end if
241
242 if dbperiod>1 then
243 dim dys(90)
244 for a=0 to dbperiod
245 dys(a) = DateAdd("d", a, out)
246 REM response.write("dates loaded in the days array " & dys(a))%><!--<br>--><%
247 REM response.write("ttime in db " & ttime)%><!--<br>--><%
248 Next
249
250 for b=0 to dbperiod
251
252 test=DateDiff("y", dys(b), ADate)
253 If test=0 then
254 If thetime="Day" THEN
255 available="no"
256 Exit Do
257 End If
258 If ttime="Day" THEN
259 available="no"
260 Exit Do
261 End If
262 If thetime=ttime THEN
263 REM response.write("x= " & x & "resp= " & resp & thetime & " " & ttime)
264 available="no"
265 Exit Do
266 End If
267
268 Else
269 available="yes"
270
271 end if
272
273 Next
274
275 end if