Microsoft VBScript runtime error '800a000d'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghanson
    New Member
    • Feb 2008
    • 3

    #1

    Microsoft VBScript runtime error '800a000d'

    I have started to have problems with my code. On one server the code works fine and on another (which is the one I need to run the scrpt on) I get

    Microsoft VBScript runtime error '800a000d'

    Type mismatch

    /ops/eus/clrm/ck_avail.asp, line 243

    The code is:

    if dbperiod>1 then
    dim dys(90)
    for a=0 to dbperiod
    dys(a) = DateAdd("d", a, out)
    REM response.write( "dates loaded in the days array " & dys(a))%><!--<br>--><%
    REM response.write( "ttime in db " & ttime)%><!--<br>--><%
    Next
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello ghanson,

    The code that you posted might be the problem. From what you posted it is incomplete code. Where is line 243? Below is some error trapping that could help ya. But without the complete block of code around line 243 to see this will be hard to solve. Please post more code so we can give better help/advice.

    Hope this helps~

    [code=asp]
    <%
    If Not (IsNumeric(dbpe riod)) Then
    Response.Write( "Error: The value for 'dbperiod' is not a numeric value!")
    Response.End()
    End If

    If Not (IsDate(out)) Then
    Response.Write( "Error: The value for 'out' is not in a date format!")
    Response.End()
    End If

    If (dbperiod > 1) Then
    dim dys(90)
    For a=0 to dbperiod
    dys(a) = DateAdd("d", a, out)
    Next
    End If
    %>
    [/code]

    Comment

    • ghanson
      New Member
      • Feb 2008
      • 3

      #3
      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("A DODB.Recordset" )
      156 reserve.open "SELECT * FROM reserve WHERE ref=" & id & "", "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ=c:/users/ClassRmCal/classrooms.mdb"
      157
      158 <!-- " -->
      159 Do WHILE NOT reserve.EOF
      160
      161 out=reserve("AD ate")
      162 ind=reserve("BD ate")
      163
      164 ttime=reserve(" thetime")
      165
      166 dbperiod = DateDiff("y", out, ind)
      167
      168
      169 if dbperiod=0 then
      170
      171 interval=DateDi ff("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=DateDi ff("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=DateDi ff("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

      Comment

      • ghanson
        New Member
        • Feb 2008
        • 3

        #4
        I guess I'm also wondering why it works on one server and not on the other.

        Comment

        • CroCrew
          Recognized Expert Contributor
          • Jan 2008
          • 564

          #5
          Are you sure that the line “dim dys(90)” is throwing the error?

          There is nothing wrong with that dim syntax. I just modified the code that I posted and it worked for me. We are both using the same syntax and I don’t get the error.

          Weird!!

          Can you re-run that page in your browser and verify that that is the line 243. Try response writing something like the word “start” before that line and then “end” after to see if that really is were the error is being thrown.

          This looks to be a fun one~

          [code=asp]
          <%
          dbperiod = 5
          out = "1/1/2008"

          If Not (IsNumeric(dbpe riod)) Then
          Response.Write( "Error: The value for 'dbperiod' is not a numeric value!")
          Response.End()
          End If

          If Not (IsDate(out)) Then
          Response.Write( "Error: The value for 'out' is not in a date format!")
          Response.End()
          End If

          If (dbperiod > 1) Then
          dim dys(90)
          For a=0 to dbperiod
          dys(a) = DateAdd("d", a, out)
          Next
          i=0
          For Each x In dys
          Response.Write( "dys(" & i & ") = " & x & "<br>")
          i=(i+1)
          Next
          End If
          %>
          [/code]

          Comment

          Working...