Link to home
Start Free TrialLog in
Avatar of pchy
pchy

asked on

FITER ERROR IN C/S

delphi4.0+SQL server6.5----
I used  Filter in table(SQL server 6.5) ,but have a error:
  "Capability not Supported!"

  can you  tell me?

THE filter is:
 
  1: table1.filter:='coid'+'='+coname.text;
 
  2: table1.filter:='coid='+''+coname.text+'';

   "coid" is fieldname; coname is Tedit
==============================================  
 
thanks everyone!

I do as:

 1: database is actived
   
 2: used quotedstr() and anther

          but it is not work!
 
Avatar of kretzschmar
kretzschmar
Flag of Germany image

hi pchy,

can you show the filter, which you want to apply?

meikl
Avatar of pchy
pchy

ASKER

Edited text of question.
Avatar of pchy

ASKER

Edited text of question.
Hi,

I have received the same error message when my database component is not in active state (not opened and connected or lost connection).

Regards,
Geo
hi again pchy,

try this change (don't now yet, if mssql awaits a quoted or a doublequoted string, here both :

single quote
table1.filter:='coid='+QuotedStr(coname.text);

doublequoted
table1.filter:='coid='+AnsiQuotedStr(coname.text,'"');

meikl

appendix,
i guess coid is a charfield and not a numeric-field.
meikl
Avatar of pchy

ASKER

Edited text of question.
Avatar of pchy

ASKER

Edited text of question.
another try
table1.filter:='coid="'+coname.text+'"';

ASKER CERTIFIED SOLUTION
Avatar of Phoenix_s
Phoenix_s

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
? in this case (answer),
should also this work
table1.filter:='coid='+QuotedStr(coname.text);
kretzschmar:  I guess... I have NEVER used the quotedstr... hehehe
hi Phoenix_s,

quotedstr is very usefull,
if you have to build a filter like
name = D'Arc
you must wrote then
Filter := 'name = ''D''Arc''';
that means also that you must parse the text if it comes from a var or editbox and you must double the singlequote. this all manages quotedstr for you.

meikl