Board index » delphi » widestring field in a paradox database

widestring field in a paradox database

What's the right way to set the value of that kind of field? I've tried many
ways of doing it but the field only received the first character of the
string I was trying to assign it. I also made a test and set a DBEdit
control to that field and it also allowed me to enter only one character.
I don't understand where is the problem.

I've tried many variations but it looked something like this:

var s:widestring;
begin
    s:='abcd';
    Table1.Fields.FieldByName('MyField').AsString:=s;
end;

and the field would become only 'a'

 

Re:widestring field in a paradox database


Quote
"mish" <misss...@yahoo.com> wrote in message <news:a9kauo$22o$1@bagan.srce.hr>...
> and the field would become only 'a'

That probably means that length of field in you table is 1.
Check this with Database Desktop.

Re:widestring field in a paradox database


Quote
> > and the field would become only 'a'
> That probably means that length of field in you table is 1.
> Check this with Database Desktop.

Yes it really is. I created the field this way:
with FieldDefs.AddFieldDef do begin
    Name:='MyField';
    DataType:=ftWideString;
    // I tried with and without the following line;
    Size:=500;
end;

And Database Desktop says that the field type is alpha (not widestring) and
size is 1.

What should I do now?

Re:widestring field in a paradox database


Quote
"mish" <misss...@yahoo.com> wrote in message <news:a9mf9p$59h$2@bagan.srce.hr>...
> And Database Desktop says that the field type is alpha (not widestring) and
> size is 1.

> What should I do now?

This simply means that Paradox doesn't support widestring fields.
You may experiment with memo field  for widestring storage

Other Threads