strange error

Discussion in 'ASP General' started by Kevin, Dec 5, 2005.

  1. Kevin

    Kevin Guest

    Hi,

    With this, i get the error:
    " Microsoft VBScript runtime error '800a01ca'
    Variable uses an Automation type not supported in VBScript "
    at line 79

    <%
    totintot=request.cookies("totintot")
    ....
    sql = "select count(*) as totuur from studres where dag>= curdate() group by
    logon having logon='" & lol & "';" Set rs = objdc.execute(sql)
    if rs.eof then
    totu=0
    else
    rsArray = rs.GetRows()
    totu = rsArray(0,0)
    end if

    if int(totu)>=int(totintot) then flgmax=1 'this is line 79
    rs.close
    %>

    With this : if totu>=int(totintot) then flgmax=1 => type mismatch

    Any idea?
    Thanks
    Chris
    Kevin, Dec 5, 2005
    #1
    1. Advertising

  2. Kevin

    Jevon Guest

    At a guess, you're trying to cast a NULL to int - what's the value of totu?

    Jevon


    "Kevin" <> wrote in message
    news:uEC6g8Z%...
    > Hi,
    >
    > With this, i get the error:
    > " Microsoft VBScript runtime error '800a01ca'
    > Variable uses an Automation type not supported in VBScript "
    > at line 79
    >
    > <%
    > totintot=request.cookies("totintot")
    > ...
    > sql = "select count(*) as totuur from studres where dag>= curdate() group
    > by
    > logon having logon='" & lol & "';" Set rs = objdc.execute(sql)
    > if rs.eof then
    > totu=0
    > else
    > rsArray = rs.GetRows()
    > totu = rsArray(0,0)
    > end if
    >
    > if int(totu)>=int(totintot) then flgmax=1 'this is line 79
    > rs.close
    > %>
    >
    > With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    >
    > Any idea?
    > Thanks
    > Chris
    >
    >
    Jevon, Dec 5, 2005
    #2
    1. Advertising

  3. Kevin

    Kevin Guest

    Thanks for replying...

    Totintot = 10
    totu = 1

    The database is Mysql, but i suppose it' not relevant.


    "Jevon" <> wrote in message
    news:ejgcaDa%...
    > At a guess, you're trying to cast a NULL to int - what's the value of

    totu?
    >
    > Jevon
    >
    >
    > "Kevin" <> wrote in message
    > news:uEC6g8Z%...
    > > Hi,
    > >
    > > With this, i get the error:
    > > " Microsoft VBScript runtime error '800a01ca'
    > > Variable uses an Automation type not supported in VBScript "
    > > at line 79
    > >
    > > <%
    > > totintot=request.cookies("totintot")
    > > ...
    > > sql = "select count(*) as totuur from studres where dag>= curdate()

    group
    > > by
    > > logon having logon='" & lol & "';" Set rs = objdc.execute(sql)
    > > if rs.eof then
    > > totu=0
    > > else
    > > rsArray = rs.GetRows()
    > > totu = rsArray(0,0)
    > > end if
    > >
    > > if int(totu)>=int(totintot) then flgmax=1 'this is line

    79
    > > rs.close
    > > %>
    > >
    > > With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    > >
    > > Any idea?
    > > Thanks
    > > Chris
    > >
    > >

    >
    >
    Kevin, Dec 5, 2005
    #3
  4. Kevin wrote:
    > Hi,
    >
    > With this, i get the error:
    > " Microsoft VBScript runtime error '800a01ca'
    > Variable uses an Automation type not supported in VBScript "
    > at line 79
    >
    > <%
    > totintot=request.cookies("totintot")
    > ...
    > sql = "select count(*) as totuur from studres where dag>= curdate()
    > group by logon having logon='" & lol & "';"


    This has nothing to do with your error but: this query is less efficient
    than it could be. Change it to:

    sql = "select count(*) as totuur from studres " & _
    "where dag>= curdate() AND logon='" & lol & "';"

    Since you're only interested in a specific logon, there is no need to force
    the database to go to the extra time and expense to group by logon and then
    filter by logon after the table has been grouped and aggregated.


    > Set rs = objdc.execute(sql)
    > if rs.eof then
    > totu=0
    > else
    > rsArray = rs.GetRows()
    > totu = rsArray(0,0)


    Again, probably nothing to do with your error, but this is overkill. There
    is no need to waste CPU and memory by moving this single record into an
    array. Simply do this:
    totu=rs(0).value

    totu=rs(0).value & ""

    > end if


    In fact, this query should never return an empty recordset: you should
    always get back a record containing 0 or higher in the first field, so
    testing for eof is not really necessary (it IS a good habit to get into, so
    consider this paragraph to be informational only).

    >
    > if int(totu) >=int(totintot) then flgmax=1 'this is line 79
    > rs.close
    > %>
    >
    > With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    >

    You need to figure out which variable it is talking about (I suspect totu is
    the problem, but ...):

    Response.Write totintot & ": " & typename(totitntot) & "<BR>"
    Response.Write totu & ": " & typename(totu) & "<BR>"
    Response.Write flgmax & ": " & typename(flgmax) & "<BR>"

    on error resume next
    Response.Write int(totu) & "<BR>"
    if err<>0 then
    response.write "totu could not be converted to int" & "<BR>"
    end if
    Response.Write int(totitntot) & "<BR>"
    if err<>0 then
    response.write "totitntot could not be converted to int" & "<BR>"
    end if

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Dec 5, 2005
    #4
  5. Kevin

    Kevin Guest

    ok, thanks

    "Bob Barrows [MVP]" <> wrote in message
    news:OG4GQga%...
    > Kevin wrote:
    > > Hi,
    > >
    > > With this, i get the error:
    > > " Microsoft VBScript runtime error '800a01ca'
    > > Variable uses an Automation type not supported in VBScript "
    > > at line 79
    > >
    > > <%
    > > totintot=request.cookies("totintot")
    > > ...
    > > sql = "select count(*) as totuur from studres where dag>= curdate()
    > > group by logon having logon='" & lol & "';"

    >
    > This has nothing to do with your error but: this query is less efficient
    > than it could be. Change it to:
    >
    > sql = "select count(*) as totuur from studres " & _
    > "where dag>= curdate() AND logon='" & lol & "';"
    >
    > Since you're only interested in a specific logon, there is no need to

    force
    > the database to go to the extra time and expense to group by logon and

    then
    > filter by logon after the table has been grouped and aggregated.
    >
    >
    > > Set rs = objdc.execute(sql)
    > > if rs.eof then
    > > totu=0
    > > else
    > > rsArray = rs.GetRows()
    > > totu = rsArray(0,0)

    >
    > Again, probably nothing to do with your error, but this is overkill. There
    > is no need to waste CPU and memory by moving this single record into an
    > array. Simply do this:
    > totu=rs(0).value
    >
    > totu=rs(0).value & ""
    >
    > > end if

    >
    > In fact, this query should never return an empty recordset: you should
    > always get back a record containing 0 or higher in the first field, so
    > testing for eof is not really necessary (it IS a good habit to get into,

    so
    > consider this paragraph to be informational only).
    >
    > >
    > > if int(totu) >=int(totintot) then flgmax=1 'this is line 79
    > > rs.close
    > > %>
    > >
    > > With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    > >

    > You need to figure out which variable it is talking about (I suspect totu

    is
    > the problem, but ...):
    >
    > Response.Write totintot & ": " & typename(totitntot) & "<BR>"
    > Response.Write totu & ": " & typename(totu) & "<BR>"
    > Response.Write flgmax & ": " & typename(flgmax) & "<BR>"
    >
    > on error resume next
    > Response.Write int(totu) & "<BR>"
    > if err<>0 then
    > response.write "totu could not be converted to int" & "<BR>"
    > end if
    > Response.Write int(totitntot) & "<BR>"
    > if err<>0 then
    > response.write "totitntot could not be converted to int" & "<BR>"
    > end if
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Kevin, Dec 5, 2005
    #5
  6. Kevin

    Kevin Guest

    One more question, please...

    The sql commands are of course dependant of the database (sql with MS access
    will have a different syntax than with Mysql), but the vbscript written in
    ASP, is it independant of the db, no? I noticed with the same application,
    but one with ms access, the other with mysql and adapted sql syntax,
    differences in the return of variables and in methods e.g. rs.RecordCount)
    Thanks


    "Bob Barrows [MVP]" <> wrote in message
    news:OG4GQga%...
    > Kevin wrote:
    > > Hi,
    > >
    > > With this, i get the error:
    > > " Microsoft VBScript runtime error '800a01ca'
    > > Variable uses an Automation type not supported in VBScript "
    > > at line 79
    > >
    > > <%
    > > totintot=request.cookies("totintot")
    > > ...
    > > sql = "select count(*) as totuur from studres where dag>= curdate()
    > > group by logon having logon='" & lol & "';"

    >
    > This has nothing to do with your error but: this query is less efficient
    > than it could be. Change it to:
    >
    > sql = "select count(*) as totuur from studres " & _
    > "where dag>= curdate() AND logon='" & lol & "';"
    >
    > Since you're only interested in a specific logon, there is no need to

    force
    > the database to go to the extra time and expense to group by logon and

    then
    > filter by logon after the table has been grouped and aggregated.
    >
    >
    > > Set rs = objdc.execute(sql)
    > > if rs.eof then
    > > totu=0
    > > else
    > > rsArray = rs.GetRows()
    > > totu = rsArray(0,0)

    >
    > Again, probably nothing to do with your error, but this is overkill. There
    > is no need to waste CPU and memory by moving this single record into an
    > array. Simply do this:
    > totu=rs(0).value
    >
    > totu=rs(0).value & ""
    >
    > > end if

    >
    > In fact, this query should never return an empty recordset: you should
    > always get back a record containing 0 or higher in the first field, so
    > testing for eof is not really necessary (it IS a good habit to get into,

    so
    > consider this paragraph to be informational only).
    >
    > >
    > > if int(totu) >=int(totintot) then flgmax=1 'this is line 79
    > > rs.close
    > > %>
    > >
    > > With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    > >

    > You need to figure out which variable it is talking about (I suspect totu

    is
    > the problem, but ...):
    >
    > Response.Write totintot & ": " & typename(totitntot) & "<BR>"
    > Response.Write totu & ": " & typename(totu) & "<BR>"
    > Response.Write flgmax & ": " & typename(flgmax) & "<BR>"
    >
    > on error resume next
    > Response.Write int(totu) & "<BR>"
    > if err<>0 then
    > response.write "totu could not be converted to int" & "<BR>"
    > end if
    > Response.Write int(totitntot) & "<BR>"
    > if err<>0 then
    > response.write "totitntot could not be converted to int" & "<BR>"
    > end if
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Kevin, Dec 5, 2005
    #6
  7. It is possible. Different database providers may provide varying levels of
    support for some methods/properties.
    RecorCount will only work if the cursor you are using supports Bookmarks.
    This will be true of all client-side cursors (adUseClient) and some
    server-side cursors depending on provider support.


    Kevin wrote:
    > One more question, please...
    >
    > The sql commands are of course dependant of the database (sql with MS
    > access will have a different syntax than with Mysql), but the
    > vbscript written in ASP, is it independant of the db, no? I noticed
    > with the same application, but one with ms access, the other with
    > mysql and adapted sql syntax, differences in the return of variables
    > and in methods e.g. rs.RecordCount) Thanks
    >
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:OG4GQga%...
    >> Kevin wrote:
    >>> Hi,
    >>>
    >>> With this, i get the error:
    >>> " Microsoft VBScript runtime error '800a01ca'
    >>> Variable uses an Automation type not supported in VBScript "
    >>> at line 79
    >>>
    >>> <%
    >>> totintot=request.cookies("totintot")
    >>> ...
    >>> sql = "select count(*) as totuur from studres where dag>= curdate()
    >>> group by logon having logon='" & lol & "';"

    >>
    >> This has nothing to do with your error but: this query is less
    >> efficient than it could be. Change it to:
    >>
    >> sql = "select count(*) as totuur from studres " & _
    >> "where dag>= curdate() AND logon='" & lol & "';"
    >>
    >> Since you're only interested in a specific logon, there is no need
    >> to force the database to go to the extra time and expense to group
    >> by logon and then filter by logon after the table has been grouped
    >> and aggregated.
    >>
    >>
    >>> Set rs = objdc.execute(sql)
    >>> if rs.eof then
    >>> totu=0
    >>> else
    >>> rsArray = rs.GetRows()
    >>> totu = rsArray(0,0)

    >>
    >> Again, probably nothing to do with your error, but this is overkill.
    >> There is no need to waste CPU and memory by moving this single
    >> record into an array. Simply do this:
    >> totu=rs(0).value
    >>
    >> totu=rs(0).value & ""
    >>
    >>> end if

    >>
    >> In fact, this query should never return an empty recordset: you
    >> should always get back a record containing 0 or higher in the first
    >> field, so testing for eof is not really necessary (it IS a good
    >> habit to get into, so consider this paragraph to be informational
    >> only).
    >>
    >>>
    >>> if int(totu) >=int(totintot) then flgmax=1 'this is line 79
    >>> rs.close
    >>> %>
    >>>
    >>> With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    >>>

    >> You need to figure out which variable it is talking about (I suspect
    >> totu is the problem, but ...):
    >>
    >> Response.Write totintot & ": " & typename(totitntot) & "<BR>"
    >> Response.Write totu & ": " & typename(totu) & "<BR>"
    >> Response.Write flgmax & ": " & typename(flgmax) & "<BR>"
    >>
    >> on error resume next
    >> Response.Write int(totu) & "<BR>"
    >> if err<>0 then
    >> response.write "totu could not be converted to int" & "<BR>"
    >> end if
    >> Response.Write int(totitntot) & "<BR>"
    >> if err<>0 then
    >> response.write "totitntot could not be converted to int" & "<BR>"
    >> end if
    >>
    >> Bob Barrows
    >> --
    >> Microsoft MVP -- ASP/ASP.NET
    >> Please reply to the newsgroup. The email account listed in my From
    >> header is my spam trap, so I don't check it very often. You will get
    >> a quicker response by posting to the newsgroup.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Dec 5, 2005
    #7
  8. Kevin

    Kevin Guest

    Thanks

    "Bob Barrows [MVP]" <> wrote in message
    news:%23%23Wicuc%...
    > It is possible. Different database providers may provide varying levels of
    > support for some methods/properties.
    > RecorCount will only work if the cursor you are using supports Bookmarks.
    > This will be true of all client-side cursors (adUseClient) and some
    > server-side cursors depending on provider support.
    >
    >
    > Kevin wrote:
    > > One more question, please...
    > >
    > > The sql commands are of course dependant of the database (sql with MS
    > > access will have a different syntax than with Mysql), but the
    > > vbscript written in ASP, is it independant of the db, no? I noticed
    > > with the same application, but one with ms access, the other with
    > > mysql and adapted sql syntax, differences in the return of variables
    > > and in methods e.g. rs.RecordCount) Thanks
    > >
    > >
    > > "Bob Barrows [MVP]" <> wrote in message
    > > news:OG4GQga%...
    > >> Kevin wrote:
    > >>> Hi,
    > >>>
    > >>> With this, i get the error:
    > >>> " Microsoft VBScript runtime error '800a01ca'
    > >>> Variable uses an Automation type not supported in VBScript "
    > >>> at line 79
    > >>>
    > >>> <%
    > >>> totintot=request.cookies("totintot")
    > >>> ...
    > >>> sql = "select count(*) as totuur from studres where dag>= curdate()
    > >>> group by logon having logon='" & lol & "';"
    > >>
    > >> This has nothing to do with your error but: this query is less
    > >> efficient than it could be. Change it to:
    > >>
    > >> sql = "select count(*) as totuur from studres " & _
    > >> "where dag>= curdate() AND logon='" & lol & "';"
    > >>
    > >> Since you're only interested in a specific logon, there is no need
    > >> to force the database to go to the extra time and expense to group
    > >> by logon and then filter by logon after the table has been grouped
    > >> and aggregated.
    > >>
    > >>
    > >>> Set rs = objdc.execute(sql)
    > >>> if rs.eof then
    > >>> totu=0
    > >>> else
    > >>> rsArray = rs.GetRows()
    > >>> totu = rsArray(0,0)
    > >>
    > >> Again, probably nothing to do with your error, but this is overkill.
    > >> There is no need to waste CPU and memory by moving this single
    > >> record into an array. Simply do this:
    > >> totu=rs(0).value
    > >>
    > >> totu=rs(0).value & ""
    > >>
    > >>> end if
    > >>
    > >> In fact, this query should never return an empty recordset: you
    > >> should always get back a record containing 0 or higher in the first
    > >> field, so testing for eof is not really necessary (it IS a good
    > >> habit to get into, so consider this paragraph to be informational
    > >> only).
    > >>
    > >>>
    > >>> if int(totu) >=int(totintot) then flgmax=1 'this is line 79
    > >>> rs.close
    > >>> %>
    > >>>
    > >>> With this : if totu>=int(totintot) then flgmax=1 => type mismatch
    > >>>
    > >> You need to figure out which variable it is talking about (I suspect
    > >> totu is the problem, but ...):
    > >>
    > >> Response.Write totintot & ": " & typename(totitntot) & "<BR>"
    > >> Response.Write totu & ": " & typename(totu) & "<BR>"
    > >> Response.Write flgmax & ": " & typename(flgmax) & "<BR>"
    > >>
    > >> on error resume next
    > >> Response.Write int(totu) & "<BR>"
    > >> if err<>0 then
    > >> response.write "totu could not be converted to int" & "<BR>"
    > >> end if
    > >> Response.Write int(totitntot) & "<BR>"
    > >> if err<>0 then
    > >> response.write "totitntot could not be converted to int" & "<BR>"
    > >> end if
    > >>
    > >> Bob Barrows
    > >> --
    > >> Microsoft MVP -- ASP/ASP.NET
    > >> Please reply to the newsgroup. The email account listed in my From
    > >> header is my spam trap, so I don't check it very often. You will get
    > >> a quicker response by posting to the newsgroup.

    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Kevin, Dec 5, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Panic
    Replies:
    2
    Views:
    5,208
    Marc Guardiani
    Oct 24, 2003
  2. kwaj
    Replies:
    1
    Views:
    423
    Egbert Molenkamp
    Mar 7, 2004
  3. Jan
    Replies:
    2
    Views:
    1,426
    Mike Treseler
    Dec 16, 2004
  4. Harvey Twyman
    Replies:
    8
    Views:
    560
    August Derleth
    Oct 25, 2003
  5. Sam
    Replies:
    2
    Views:
    145
    Bob Barrows [MVP]
    Nov 16, 2007
Loading...

Share This Page