table problem 2

i want to use edit1.text in table.filter
i try:
table1.filter:='name ='+edit1.text;

what's wrong this :)

janozzy
janozzyAsked:
Who is Participating?
 
SuperSyConnect With a Mentor Commented:
I think you have to put the text in single quotes. (name = 'quake' instead of name = quake)
Right now your program is testing for equality of field 'name' and field 'quake', and of course the second one will not be found.  

Try this:
Table1.Filter := 'Name = ''' + Edit1.Text + '''';
0
 
SuperSyCommented:
Nothing!  

If you are saying that the filter is not working, that is a different issue.  Even though there is nothing wrong with

table1.filter := 'name = ' + edit1.text;

the filter will not work unless you set TDataset.filtered to True.  

In any case, tell what's wrong and how.  =)

0
 
janozzyAuthor Commented:
filtered is set to true

i write quake in edit1.text
then comes error FIELD QUAKE NOT FOUND

0
 
janozzyAuthor Commented:
thank supersy
now filter works:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.