Discussion Locked

passing adodb rst into an array

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
can i pass a adodb rst into an array using vb code? if so how can i retrieve my rst from the array? thx!!

3 replies

by tony hopkinson

Bit more info
By rst I presume you mean recordset ?
Do you want an array of recordsets.
Do want want to access all the records or just the one pointed at.
Is this the recordset fron one particular request, or a more generic solution, and last but not least why an array ?

by plr007

could you please be specific to your idea. you can directly access your data and store to datasource(table). why used an array?

by rrv

Instead of Array use Collection. Create a function to fill the collection with data from adodb rst and second function to return adodb rst from collection. The methods of the collection enable you to do this work like Add, Move, Sort, Remove etc. Use ICollection to implement a unknown datatype so your data from recordset can be any datatype at runtime.

Of course inside the function you have to iterate the RST to fill the collection and iterate the collection with its keys to add new records to return as RST.

Good Luck
RV

This discussion is closed to new replies.