 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rahul Guest
|
Posted: Tue Sep 12, 2006 5:55 pm Post subject: TQuery for nVarChar (Bug)? |
|
|
Hello Firends,
I am using a TQuery object to read from the database in which one
column is a nVarChar. The Query is firing well and i Couldn't fetch the
nVarChar field, if i use
VarToWideStr(Query1.FieldByName('nVarCharField').AsVariant). The
application is giving access violation. If i access the Database object
of the Query1, i could find the nVarCharField column in the fieldlist.
But, Database object doesn't provide a means to access the Field.
Please help me on this as the application which i m developing is for
Multilingual Support. I have used ADOQuery and it worked well. But,
shifting the entire project to ADO is a mess.
I am using professional edition of delphi6. When i tested the same
on Enterprise edition of delphi6, it worked well without any problems.
Is this a bug in delphi 6 professional or TQuery won't support nVarChar
in professional edition? Thanks in advance.
Thanks and Regards,
Rahul.W
Software Engineer,
3i-Infotech, India |
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Wed Sep 13, 2006 12:51 am Post subject: Re: TQuery for nVarChar (Bug)? |
|
|
You must cast to TWideStringField:
yourWideString := (Query1.FieldByName('nVarCharField') as
TWideStringField).AsVariant
--
With best regards, Mike Shkolnik
E-mail: mshkolnik (AT) scalabium (DOT) com
WEB: http://www.scalabium.com
"Rahul" <w.rahul (AT) gmail (DOT) com> wrote in message
news:1158065757.774678.307970 (AT) i42g2000cwa (DOT) googlegroups.com...
| Quote: | Hello Firends,
I am using a TQuery object to read from the database in which one
column is a nVarChar. The Query is firing well and i Couldn't fetch the
nVarChar field, if i use
VarToWideStr(Query1.FieldByName('nVarCharField').AsVariant). The
application is giving access violation. If i access the Database object
of the Query1, i could find the nVarCharField column in the fieldlist.
But, Database object doesn't provide a means to access the Field.
Please help me on this as the application which i m developing is for
Multilingual Support. I have used ADOQuery and it worked well. But,
shifting the entire project to ADO is a mess.
I am using professional edition of delphi6. When i tested the same
on Enterprise edition of delphi6, it worked well without any problems.
Is this a bug in delphi 6 professional or TQuery won't support nVarChar
in professional edition? Thanks in advance.
Thanks and Regards,
Rahul.W
Software Engineer,
3i-Infotech, India
|
|
|
| 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
|
|