Board index » cppbuilder » Why cannot I get the results with tadoquery

Why cannot I get the results with tadoquery


2004-04-26 04:45:48 PM
cppbuilder88
Hi,
I got the sql string by the folowing sentence:
EdtSearchKeywords->Text = MainQr->SQL->GetText();
//MainQr is a TAdoQuery component.
// EdtSearchKeywords is a TEdit component.
The sql is:
select cname1 as ChineseWords1,ename1 as ChineseWords2,
casno as ChineseWords3,wgh as ChineseWords4,lastopentime
from quicktable where cname1 like '*ChineseWords5*'
order by lastopentime.
When I run the sql above directly in Access2000, it
returns 78 records. But when I use the MainQr, it
returns none!
I changed the sql string to:
select cname1 as ChineseWords1,ename1 as ChineseWords2,
casno as ChineseWords3,wgh as ChineseWords4,lastopentime
from quicktable order by lastopentime.
then the MainQr runs correctly.
Is it the reason of Chinese words? And how to resolve it?
 
 

Re:Why cannot I get the results with tadoquery

Quote
[...] where cname1 like '*ChineseWords5*'
Not sure but why don't you try: '%ChineseWords5%' ?
Best regards,
Vladimir Stefanovic
 

Re:Why cannot I get the results with tadoquery

The result is correct after i tried '%ChineseWords5%'.
Thank you very much!
"Vladimir Stefanovic" < XXXX@XXXXX.COM >写入消息新闻
: XXXX@XXXXX.COM ...
Quote
>[...] where cname1 like '*ChineseWords5*'

Not sure but why don't you try: '%ChineseWords5%' ?

Best regards,
Vladimir Stefanovic



 

{smallsort}