Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array filled from table

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hola,

I have an array nice working.

The elements number of the array can slightly change for next actions. I like to put the elements in a table and fill the array (the elements) with the values of the table.

1. Can this ? How to write this. To get the data with a recordset I suppose.
2. Can this slow down the performance. Now already with an array who feeds a function my query takes a long time to get, calculate the data (1.500.000 records).

Code:
Dim RightReeks() As Variant

RightReeks = Array("S A", "SA", "S.A.", "SRL", "S.A", "SA.")
 
    For i = LBound(RightReeks) To UBound(RightReeks)
 
    If (razon Like "* " & RightReeks(i)) Then
        RazonFArray = CStr(RightReeks(i))
    End If
Next i
i = Empty


 
Have a look at the GetRows method of the recordset.

Yes, filling an array with a very large recordset could well harm performance. The larger the array (in terms of columns and rows) the more space it will take in memory.

Ed Metcalfe.

Please do not feed the trolls.....
 
I'd use a RightReeks table and a left outer join on the Like condition and thus NO function call ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
ok, thanks for the answers.
Good to know that this will slow down performance.
Table itself is not to big (# 70 records).
If I should try this. Has someone a snippet on how to fill the array (is the array taking a variable ?)

I am using a function to get out the legal function out of a string (name of the company). I think I can do this best with a function ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top