PDA

View Full Version : Count number of items in sql with vb6.0


golffor1
02-29-2008, 10:15 PM
Hello...I have an array that I don't know how big the array will be. I was wondering what the best way to count the number of entries in a database will be. I am using vb6.0 as the coding language, and sql.


When I have my sql statement and set it to a variable it displays my sql statement in a text box. But want I want to try to do is set it to a variable and then have the variable be the item in the array.

I hope that makes sense. If it does not let me know and I will do my best to explain better.

Thanks

Rhiever
03-18-2008, 06:40 AM
You can use the SQL COUNT function to count how many records you're going to be querying. Here's a web site that explains the COUNT function.

http://www.techonthenet.com/sql/count.php

Once you query how many records you're actually querying, you know what size to make the array... and well, it's cake from there.

Hope this helps.