 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Penny Guest
|
Posted: Fri Jul 29, 2005 9:08 am Post subject: nvarchar fields & Twidestringfields |
|
|
Hi,
(SQL Server 2000, Delphi 7)
All the string fields in my database have been defined as nvarchar.
According to the field I have also change the size to the desirable. eg. 10.
In my delphi application I use TAdoDatasets in order to display the data.
When I load the fields to the dataset, these of type nvarchar are loaded as
widestringfields.
When I run the program, although I have defined a field of nvarchar(10) I
can enter more than 10 characters. What I need to be able to enter only as
many characters as I have defined in my database.
What I found and seems working, is to remove the field from the dataset and
load it again as TStringField, but I can't believe that this is best way to
do it.
Any idea?
Thanks.
|
|
| Back to top |
|
 |
helmut woess Guest
|
Posted: Sun Jul 31, 2005 12:33 pm Post subject: Re: nvarchar fields & Twidestringfields |
|
|
Am Fri, 29 Jul 2005 12:08:43 +0300 schrieb Penny:
| Quote: | Hi,
(SQL Server 2000, Delphi 7)
All the string fields in my database have been defined as nvarchar.
According to the field I have also change the size to the desirable. eg. 10.
In my delphi application I use TAdoDatasets in order to display the data.
When I load the fields to the dataset, these of type nvarchar are loaded as
widestringfields.
When I run the program, although I have defined a field of nvarchar(10) I
can enter more than 10 characters. What I need to be able to enter only as
many characters as I have defined in my database.
What I found and seems working, is to remove the field from the dataset and
load it again as TStringField, but I can't believe that this is best way to
do it.
Any idea?
Thanks.
|
If you mean, you want to limit the characters which can be entered in a
dbfield then use property MaxLength.
And for working with widestring/unicode you cannot use the standard edit
fields, you need unicode edit fields like the free TNT Components - but i
think this is well known.
bye,
Helmut
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|