473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What am I doing wrong, I though this would be simple..

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

Jul 19 '05 #1
2 1435
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


Jul 19 '05 #2
Ah, yes, I think that was just in a recent thread too. I remember reading
that in a thread recently anyway. I'll consider myself slapped. :]

Ray at work

"TomB" <sh*****@hotmail.com> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
11
by: Alfonso Morra | last post by:
Hi, I am at the end of my tether now - after spending several days trying to figure how to do this. I have finally written a simple "proof of concept" program to test serializing a structure...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
11
by: justsome_newbie | last post by:
Hello experts! I'm trying to send mail from my C# Asp.Net webpage. I used the code samples at www.systemnetmail.com but it still won't send. I think the problem is on the iis or exchange server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.