
Redim subscript out of range?
Hi,
rows = 0
While ret = CS_SUCCEED Or ret = CS_ROW_FAIL
ret = cmd_ptr.vbct_fetch(CS_UNUSED, CS_UNUSED, CS_UNUSED,
outlen)
If ret = CS_SUCCEED Then
If rows = 0 Then
rows = 1
Else
rows = UBound(Tuples, 1)
End If
ReDim Preserve Tuples((rows + 1), 9) '****HERE******
For Col = 1 To ncols.Data
Tuples(rows - 1, Col - 1) = cmd_ptr.vbct_data(Col)
Next Col
End If
Wend
Above is code for my SQL Sombrero. What it does is retrieve sybase rows
line by line. The problem is that if I leave Preserve statement the
ReDim fails with subscript out of range error. I made sure that I am not
getting into problem where I am decreasing the subscript. So, that's not
the problem.
When I take the Preserve out, then it works.
Any ideas?
--
*****************************************************************************
S. Hoon Yoon (Quant) Merrill {*filter*} Equity Trading,
"Miracle is always only few standard deviations away, but so is
catastrophe."
* Expressed opinions are often my own, but NOT my employer's.
"I feel like a fugitive from the law of averages." Mauldin
*****************************************************************************