S
Sid Price
I have an application that needs to add a column to one of its database
tables. I am doing this with the "ALTER TABLE" command and setting the new
column to have a width of 80. The query looks like this:
DBCommand.CommandText = "ALTER TABLE " & strTableName & " ADD "
& strColumnName & " char(" & iColumnSize & ")"
DBCommand.ExecuteNonQuery()
Later the new column in the table may have data assigned into the new
column. When this is done the data entered into the column is always 80
chars long regardless of the actual string length. This is not the behavior
we see if we add the column in Access and enter text in the new field. I
have examined the table design in Access and do not see any difference
between this column and other text columns except for the length (80 instead
of 50 in other columns).
Is there some attribute that needs to be set on the new column so that the
entry is not space-filled to the maximum column size?
Thanks,
Sid.
tables. I am doing this with the "ALTER TABLE" command and setting the new
column to have a width of 80. The query looks like this:
DBCommand.CommandText = "ALTER TABLE " & strTableName & " ADD "
& strColumnName & " char(" & iColumnSize & ")"
DBCommand.ExecuteNonQuery()
Later the new column in the table may have data assigned into the new
column. When this is done the data entered into the column is always 80
chars long regardless of the actual string length. This is not the behavior
we see if we add the column in Access and enter text in the new field. I
have examined the table design in Access and do not see any difference
between this column and other text columns except for the length (80 instead
of 50 in other columns).
Is there some attribute that needs to be set on the new column so that the
entry is not space-filled to the maximum column size?
Thanks,
Sid.