piero1975
Board Regular
- Joined
- Nov 20, 2002
- Messages
- 56
I'm trying ti use a bi-dimensional array to retrive data in my Excel workbook from a Oracle fetch curosor.
The part of code interested is
COLNUM = 0
riga = 0
'rpt is the cursor
fldcount = RPT.FIELDS.Count
ReDim flds(0 To rpt.RecordCount - 1, 0 To fldcount)
For riga = 0 To RPT.RecordCount - 1
For COLNUM = 0 To fldcount - 1
Set flds(riga, colnum) = RPT(colnum)
Next colnum
RPT.DBMOVENEXT
Next riga
RPT.Close
Set RPT = Nothing
It works.....except that in my array I can find ONLY the last record fetched...
So I've several thousand of equal records....
Where I'm making a mistake?
Can you help me?
The part of code interested is
COLNUM = 0
riga = 0
'rpt is the cursor
fldcount = RPT.FIELDS.Count
ReDim flds(0 To rpt.RecordCount - 1, 0 To fldcount)
For riga = 0 To RPT.RecordCount - 1
For COLNUM = 0 To fldcount - 1
Set flds(riga, colnum) = RPT(colnum)
Next colnum
RPT.DBMOVENEXT
Next riga
RPT.Close
Set RPT = Nothing
It works.....except that in my array I can find ONLY the last record fetched...
So I've several thousand of equal records....
Where I'm making a mistake?
Can you help me?