2D Array to 1D Array 
Author Message
 2D Array to 1D Array

I  think some of the problems I'm having using an array within my SQL
statement is the fact that its a 2D array (coming in as a recordset from
LDAP). What's the easiest(or best) way of converting that 2D array into a 1D
array?

Thanks,
Jim



Fri, 23 Jul 2004 22:10:16 GMT  
 2D Array to 1D Array
Hmmm,

A brute force method might be:

rs.MoveFirst
strWhatever = rs.fields("fieldname").value
While NOT rs.EOF
  strWhatever = "," & rs.fields("fieldname").value
  rs.MoveNext
Wend
arr1D = split(strWhatever, ",", -1, 1)

If there are commas in your values you would want to
choose a different delimeter.

I couldn't figure out a way to do it without a loop
rs.GetString would work great instead of the loop
if you could just pull one of the fields out, but I don't see
that in the docs.  Or if there was a way to make a new
recordset out of the original with just the field you want
(without a loop) then use rs.GetString and split() but I
couldn't find that either.

Can you make a recordset with just the field you want??

http://msdn.microsoft.com/library/en-us/ado270/htm/mdmscadoapireferen...
frame=true

gl,
Bill Wallace


Quote:
> I  think some of the problems I'm having using an array within my SQL
> statement is the fact that its a 2D array (coming in as a recordset from
> LDAP). What's the easiest(or best) way of converting that 2D array into a
1D
> array?

> Thanks,
> Jim



Sat, 24 Jul 2004 01:44:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Convert 2d array to 1d array

2. wsh/ jscript : BUG : array of array, 2D array

3. Array of Arrays and 2D array

4. Array Filter Function and 2D Array

5. Control arrays greater that 1D

6. program control of 2D to 1D

7. passing 2D array

8. dynamic 2d arrays

9. passing 2D array

10. Extract a row from a 2D array

11. recordset into 2d array using getrows()

12. Using a var in 2D-array

 

 
Powered by phpBB® Forum Software