Automatially Trim WideStrings

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
johnbitner
Posts: 22
Joined: Thu 10 Sep 2009 16:18
Location: United States

Automatially Trim WideStrings

Post by johnbitner » Tue 15 Sep 2009 14:46

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 16 Sep 2009 12:38

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.

johnbitner
Posts: 22
Joined: Thu 10 Sep 2009 16:18
Location: United States

Post by johnbitner » Wed 16 Sep 2009 14:15

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 17 Sep 2009 08:10

Set the TrimVarChar option of TUniQuery to True.

Post Reply