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 

TQuery for nVarChar (Bug)?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases
View previous topic :: View next topic  
Author Message
Rahul
Guest





PostPosted: Tue Sep 12, 2006 5:55 pm    Post subject: TQuery for nVarChar (Bug)? Reply with 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
Mike Shkolnik
Guest





PostPosted: Wed Sep 13, 2006 12:51 am    Post subject: Re: TQuery for nVarChar (Bug)? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases 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.