I am looking at one of our legacy systems which contains some code similar to the code below.
I understand that it is opening a connection and selecting values from tabla. Then it checks if the total rows are greater than 0.
Please can someone tell me what ReDim function is doing, this will then give me a better understanding of how the For loop is working.
Dim abc as string
Dim a1 as integer
Dim a2 as integer
Dim rtotal as integer
Dim anrecord as new adodb.recordset
Dim sqla as string
sqla = select avalue, bvalue from tablea
anrecord.open.sqltext, currentproject,connection, asOpenKeyset, adLockOptimistic
rtotal = anrecord.recordcount
If rtotal > 0 then
ReDim abc(rtotal,2)
anrecord.movefirst
For a1 =1 to rtotal
abc(a1, 1) = anrecord.avalue
abc(a1, 2) = anrecord.bvalue
Next
anrecord.close