I have an access database with a pair of tables. I know how many fields are in the table (42 and 36). I want to load, using an array, the field lengths of each field into an array. Why doesn't the following work? It gives me a -1 for each element in the array instead of the numeric length of the field. Here is what I have:
VB Code:
  1. For i = 0 To 42
  2.             tcrhdrfldlen(i) = tcrhdrdt.Columns(i).MaxLength
  3.         Next i
  4.  
  5.         For i = 0 To 36
  6.             tcrdtrfldlen(i) = tcrdtrdt.Columns(i).MaxLength
  7.         Next i

Here is what worked in VB5:
VB Code:
  1. For i = 0 To 42
  2.             tcrhdrfldlen(i) = tcrhdrdt.Fields(i).Size
  3.         Next i
  4.  
  5.         For i = 0 To 36
  6.             tcrdtrfldlen(i) = tcrdtrdt.Fields(i).Size
  7.         Next i

Thanks for the help!