BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

nvarchar fields & Twidestringfields

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Penny
Guest





PostPosted: Fri Jul 29, 2005 9:08 am    Post subject: nvarchar fields & Twidestringfields Reply with 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.




Back to top
helmut woess
Guest





PostPosted: Sun Jul 31, 2005 12:33 pm    Post subject: Re: nvarchar fields & Twidestringfields Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.