I said that once and got a good slapping, when doing a count (I was told)
you want to use the asterisk as you may not get an accurate count. I
believe it had to do with NULLS, even if you did a COUNT(ID) where ID is the
PK and obviously wouldn't be Null.
Tom B
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl...
Do you need to count(*) as opposed to just counting one column?
You can use "SELECT COUNT([Something]) AS [TheCount] FROM [resort]..."
and then use
i = rsIslandInfo("TheCount").Value
Or better:
strQuery = "SELECT COUNT([Something]) FROM [resort]..."
Set rsIslandInfo = adoConn.Execute(strQuery)
i = rsIslandInfo.Fields.Item(0).Value
Ray at home
--
Will trade ASP help for SQL Server help
"Graham Mattingley" <gr****@technocom.com> wrote in message
news:bh*******************@news.demon.co.uk... I am trying to count the records in a database, and make an array from
the answer this is the code
strQuery = "SELECT count(*) FROM resort where island_id=
'"&island_drop&"' ;"
Set rsIslandinfo = adoConn.Execute(strQuery)
i = rsIslandinfo("count(*)").Value
** this bit above here works find I have done a response.write to check
I have a number in i
*** I have tryed it with and without the CInt command ***
i=CInt (i)
dim ics (i,2)
I am sure this is possible, what am I doing wrong ??
I just an ERROR 500
Help :-)
Graham