
Headbang: Annoyed users, trailing spaces, SQL 6.5 field length, txt box, MaxLength
Man o man, I sure could use a few tips on this problem of mine. It
seems so simple....
In the dataenviron I've got a working OLE DB connection to a SQL 6.5
server and a working updatable recordset.
I've got a form with a bunch of txt controls (aka single-line-edit)
bound to the fields of the recordset.
Alrighty. Things work well, as long as what I input into a text box
doesn't exceed the field size (or else I get a "Data Access error".)
So to prevent errors, I set the MaxLength of the text box to, say, 40
characters, the size of the field to which the text box is bound.
But here's the pisser: because all the fields in the database are
padded with spaces (as per the SQL recommendation) every text box is
automatically "full." A four-letter word (which I find myself using a
lot recently) in a 40-char field fills up the text box with 36 spaces.
Here's why it's annoying. If the user clicks on the text box and
types something, **nothing happens because the text box has reached
its MaxLength because of all the spaces.** The user has to either 1)
double-click to highlight the text so subsequent keystrokes replace
the text, making room for what's to come or 2) drag-select a portion
of the text box.
My objective: a situation where a user can click on a text box and
(gasp) edit the field (without having to double-click or select or
replace all the text or other such nonsense.)
All hints and/or condolences (or gondolas) are VERY welcome.
(P.S. The solution, AFAIK, is NOT ANSI_PADDING. that only affects in
coming data. It doesn't lessen the squeeze of "full" text boxes read
from the db.)