Forum Moderators: open

Message Too Old, No Replies

query driving me mad

some problem with getrows, and dbls..

         

natty

10:48 am on Nov 2, 2004 (gmt 0)

10+ Year Member



hi all,

i have a page running a simple report from a database..
i use getrows on all my querys, but im getting a problem.
report has a field running a query with a WHERE clause on the end, but the page is falling over when i attempt to do
totalTime = totalTime + aItems(3,x)

aItems being the array returned from getrows().
problem is that the page as i said falls over on this line, saying
Type mismatch: 'aItems(...)'

if i response.write aitems(3,x) i get numbers.. for instance..
5.02

i tried using cdbl, but no luck , i even changed the query to cdbl the field before it gets 'getrowed' but then the page falls over on my little run query function on the line

arrMenuItems = oRS.getRows()
it does have a
if not (oRS.EOF and oRS.BOF) then
before it so not that ...
so anyone have any idea why this is happening, surely cdbl,cint etc should be able to be used?

any help very much appreciated as always

tia

nathan

makeupalley

12:43 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Hi Nathan,

Is the array named arrMenuItems or aItems?

Elky

natty

1:55 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



hi there,
in the getrows function the array is called aMenuItems, and the function returns that array.. like so

aItems = doQuery(q)
doQuery being the function that runs the query and returns the array..


function doQuery(q)
set oRS = oConn.execute(q)

if not (oRS.EOF and oRS.BOF) then
arrMenuItems = oRS.getRows()
else
arrMenuItems = null
end if
doQuery = arrMenuItems

oRS.close
set oRS = nothing
end function


then a simple check with isnull and im away with a query.
i think howvever, that i may have fixed it..
i the query in access.. (yes i know access sucks) i was doing a format(blah, "0.00") ..
which i took out, to do the formatting in the asp. and it seems to have done the trick..