By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

strange error

P: n/a
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
Dec 5 '05 #1
Share this Question
Share on Google+
7 Replies


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

Jevon
"Kevin" <ks****@smart.ca> wrote in message
news:uE****************@TK2MSFTNGP15.phx.gbl...
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

Dec 5 '05 #2

P: n/a
Thanks for replying...

Totintot = 10
totu = 1

The database is Mysql, but i suppose it' not relevant.
"Jevon" <pl****@ask.com> wrote in message
news:ej***************@TK2MSFTNGP11.phx.gbl...
At a guess, you're trying to cast a NULL to int - what's the value of totu?
Jevon
"Kevin" <ks****@smart.ca> wrote in message
news:uE****************@TK2MSFTNGP15.phx.gbl...
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


Dec 5 '05 #3

P: n/a
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.
Dec 5 '05 #4

P: n/a
ok, thanks

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OG****************@tk2msftngp13.phx.gbl...
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.

Dec 5 '05 #5

P: n/a
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:OG****************@tk2msftngp13.phx.gbl...
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.

Dec 5 '05 #6

P: n/a
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:OG****************@tk2msftngp13.phx.gbl...
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.
Dec 5 '05 #7

P: n/a
Thanks

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:OG****************@tk2msftngp13.phx.gbl...
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.

Dec 5 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.