Click to See Complete Forum and Search --> : Array search


Samantha
December 28th, 1999, 05:03 PM
Two Questions:

1.
I am returning a recordset of information that I want to store in a variant array. The RecordCount property, for the recordset, tells me I have RecordCount of 17. When I go to make the variant array equal to what is being stored in the recordset,the UBound of the variant array is now only showing a count of 13. Is there a specific reason as to why I am loosing information from the transfer??

2.
I have a large recordset of information (RecordCount = 53000); this will be stored in a variant array. I need to be able to loop through the array, and compare a separate specific piece of information (ie. Client ID) with that stored in the array. Would the best way to do this be by performing a Binary Search?? If not does anyone have any other suggestions??

Thanks,
Sam

Dr_Michael
December 29th, 1999, 02:02 AM
As far as I know the property RecordCount doesn't work well. Please tell me which ADO do you use, 2.0, 2.1, 2.5 ???
The other thing that I'd like to ask is why do you have to pass all the values to an array in order to search for? I think you could do your search inside recordset with the methods that ADO provides...

Michael Vlastos
Automation Engineer
Company SouthGate Hellas SA
Development Department
Athens, Greece

Crazy D @ Work
December 29th, 1999, 02:07 AM
I agree with that. To be sure the recordcount works fine you need to do a MoveLast and then a MoveFirst again.
Indeed, why do you want to put it in array before you search? If you are looking for a specific set of records (with a certain ID or something) you can open the recordset with a query like
"SELECT * FROM mytable WHERE ID = " & lID
That way you only get the records you want.

Crazy D @ Work :-)