Array Declaration in VB 6.0 - TechRepublic
General discussion
June 29, 2001 at 04:22 AM
afisher

Array Declaration in VB 6.0

by afisher . Updated 25 years ago

When I try to specify the upperbound of strValues by referencing tempRS’s record count property I get a subscript out of range error. Any suggestions?

Dim tempRS As Recordset
Dim intUpperbound As Integer
Dim i As Integer
Dim strValues() As String
Dim strSQL As String
Set tempRS = New Recordset
strSQL = “SELECT tblContacts.CAddress FROM tblContacts;”
tempRS.Open strSQL, CN, adOpenDynamic, adLockOptimistic
ReDim strValues(0 To tempRS.RecordCount – 1) As String

This discussion is locked

All Comments