Hello Ken, I wasn't thinking straight after all, I needed to have the 3 columns as DISTINCT and I assumed I could have multiple DISTINCTS in a select statement - I can't! :-)
So I ended up running 3 SELECT DISTINCTS fieldname in the same Command Object which returns 3 recordsets, I then GetRows on the first, move to the next RS, and repeat. This is the only way I could think of to get it working. It seems ok... at the moment. Cheers, Nick :> -----Original Message----- :> Nick, :> :> Why are you copying data into three different arrays? IMHO it :> would be more :> scalable to copy the data into a single array. :> :> Some quick points: :> - "Looping" through an array is very different to looping through a :> recordset calling by calling methods. One is a data structure, :> and the other :> is an object :> :> - calling objRS.GetRows(...) three times on an adOpenForwardOnly :> recordset :> might end up being slower, since if the data has fallen out of the OLEDB :> Cursor Cache, then either the code will bomb (scrolling isn't :> permitted), or :> the query will be re-executed to repopulate the recordset (which would a :> relatively huge performance hit) :> :> Cheers :> Ken :> :> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :> From: "Nick Middleweek" <[EMAIL PROTECTED]> :> Subject: RE: One Select, 3 columns to fill 3 arrays? :> :> :> : Typical! :-) :> : :> : I think I've found the answer! It's possible to specify the fields you :> want :> : to return with GetRows(rows,start,"field1") :> : :> : :> : Cheers, :> : Nick :> : :> : :> : :> -----Original Message----- :> : :> From: Nick Middleweek [mailto:[EMAIL PROTECTED]] :> : :> Sent: 30 August 2002 02:07 :> : :> To: ActiveServerPages :> : :> Subject: One Select, 3 columns to fill 3 arrays? :> : :> :> : :> :> : :> Hello, :> : :> :> : :> I can't think straight at the moment. Is it possible to do this... :> : :> :> : :> :> : :> Perform ONE select field1, field2, field3 from ... operation on :> : :> my MSSQL db. :> : :> :> : :> And then perform something similar to GetRows on the objRS :> so I end up :> : :> copying the column data into the 3 arrays. :> : :> :> : :> Can I do this quickly? :> : :> :> : :> Or do I need to loop through the objRS with MoveNext - I was :> : :> trying to avoid :> : :> this and wanted a quick solution like GetRows. :> : :> :> : :> I know I can do GetRows, then loop through that 2D array but :> : :> that's kind of :> : :> slow as well isn't it? :> : :> :> : :> :> : :> Any ideas? :> :> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :> :> :> --- :> You are currently subscribed to activeserverpages as: :> [EMAIL PROTECTED] :> To unsubscribe send a blank email to :> %%email.unsub%% :> --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
