> ' Return the field length > ' expO1 DataSet > ' expC1 Table > ' expC2 Field > Public Shared Function GetFieldLength(ByVal toDataSet As DataSet, ByVal tcTable As String, _ > ByVal tcField As String) As String > Dim loColumn As DataColumnCollection > loColumn = GetColumn(toDataSet, tcTable) > Return loColumn.Item(loColumn.IndexOf(tcField)).MaxLength > End Function > > ' Return the field length by the use of a columns > ' expO1 DataSet > ' expC1 Table > ' expC2 Field > Public Shared Function GetFieldLengthFromColumn(ByVal toColumn As DataColumnCollection, _ > ByVal tcField As String) As String > Return toColumn.Item(toColumn.IndexOf(tcField)).MaxLength > End Function > >>
> ' Return the columns from a table > ' expO1 DataSet > ' expC1 Table > Public Shared Function GetColumn(ByVal toDataSet As DataSet, Optional ByVal tcTable As String = "Temp") _ > As DataColumnCollection > Return toDataSet.Tables(tcTable).Columns > End Function >That's what I was afraid of. You're using MaxLength. Test it you'd get -1 for both char fields and memo field.