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!
 
pchyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
hi pchy,

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

meikl
0
pchyAuthor Commented:
Edited text of question.
0
pchyAuthor Commented:
Edited text of question.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

geobulCommented:
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
0
kretzschmarCommented:
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

0
kretzschmarCommented:
appendix,
i guess coid is a charfield and not a numeric-field.
meikl
0
pchyAuthor Commented:
Edited text of question.
0
pchyAuthor Commented:
Edited text of question.
0
kretzschmarCommented:
another try
table1.filter:='coid="'+coname.text+'"';

0
Phoenix_sCommented:
try this one out for size...

table1.filter := 'coid = '''+coname.text+'''';

and yes... those are all single quotes.

SQL Server likes single quotes strings for queries and the only way to do it is to use a '' within the quotes on a string to make a single ' to be passed to sql server

I have to do this kinda crap on an almost daily basis and I KNOW it works ;)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kretzschmarCommented:
? in this case (answer),
should also this work
table1.filter:='coid='+QuotedStr(coname.text);
0
Phoenix_sCommented:
kretzschmar:  I guess... I have NEVER used the quotedstr... hehehe
0
kretzschmarCommented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.