I have an array I create from data from my SQL database. I've already checked the procedures within SQL and they work. In fact, when I debug my recordcount is correct - 84. However, when I run my page that displays the array I only receive 5 records. I can get the first five, last five, I even got the 5 in the middle. There are 5 elements (name, city, etc) and those appear correctly, but the length of the array is only appearing as 5 when I KNOW it's 84. Please look at the following code...Any suggestion would be appreciated...
Now I have recently posted about the finding zip code aspect of this in an effort to create the SQL in VB. At the moment I just have to make it work the way I originally had it. UNFORTUNATELY this nitwit deleted my function instead of commenting it out which is why I seem to be missing something simple now. Please help the brain dead.
-trix
"Wiggle your big toe.
Code:
Public Function GetClubsFromZip(zip As Integer) As Variant
Dim csql$, i%, x%, count%
Dim myarray
ReDim myarray(4, 0)
OpenSQLConnection
Dim rs1 As New ADODB.Recordset
Set rs1 = CreateObject("ADODB.Recordset")
csql$ = "GetZipCodesWithin50Miles " & zip
With rs1
.ActiveConnection = rdoConn
.CursorLocation = adUseClient
.LockType = adLockReadOnly
.CursorType = adOpenForwardOnly
.Open (csql$)
End With
If Not rs1.EOF Then
While rs1.EOF = False
ReDim Preserve myarray(4, rs1.RecordCount)
For x = 0 To rs1.RecordCount - 1
myarray(0, x) = rs1(0)
myarray(1, x) = rs1(1)
myarray(2, x) = rs1(2)
myarray(3, x) = rs1(3)
myarray(4, x) = rs1(4)
rs1.MoveNext
Next x
myarray(0, count) = TakeoutdoubleQuote(CStr(myarray(0, count)))
Wend
Else
For i = 0 To 4
myarray(i, 0) = "NONE"
Next i
End If
rs1.Close
Set rs1 = Nothing
rdoConn.Close
Set rdoConn = Nothing
GetClubsFromZip = myarray
End Function
Now I have recently posted about the finding zip code aspect of this in an effort to create the SQL in VB. At the moment I just have to make it work the way I originally had it. UNFORTUNATELY this nitwit deleted my function instead of commenting it out which is why I seem to be missing something simple now. Please help the brain dead.
-trix
"Wiggle your big toe.