Page 1 of 1

Automatially Trim WideStrings

Posted: Tue 15 Sep 2009 14:46
by johnbitner
All widestrings are full field length when read with .AsWideString from database using AccessProvider. A 100 char string field is read and not trimmed and remains 100 char in length no matter what the field contains when displayed in grid, field, label, etc...

Using the same application with the SQLServerProvider all widestings are trimmed automatically.

What am I missing?

Again,
Using the AccessProvider (strings are not trimmed).
Using the SQLServerProvider (strings are trimmed).

Thanks.

Posted: Wed 16 Sep 2009 12:38
by Plash
We could not reproduce the problem. Maybe your database contains string data with trailing blanks. Try to add a new record to the table without trailing blanks. Then reopen the table and see the result.

Posted: Wed 16 Sep 2009 14:15
by johnbitner
Yes, it has trailing blanks. Not sure how but it does.

But, the question is why is the data trimmed using uniDAC SQL SERVER provider and same data in MSAccess database with uniDAC ACCESS provider not trimmed?

Shouldn't it be trimmed across all providers? Is there a provider option(s) I'm missing?

Thanks.

Posted: Thu 17 Sep 2009 08:10
by Plash
Set the TrimVarChar option of TUniQuery to True.