Query in dbgrid paradox 7 using edit in delphi

1

I am very interested in learning programming in Delphi. I already know many things, but I still do not know how to manipulate Database.
Good, without delays. I would like to know how to query the Paradox 7 database with Delphi using TEdit in the example below:

In my Form I have TTable1 , TDatasource1 , TDbgrid1 , TDbnavigator and a TEdit1 . Everything is already properly connected to return% as% of values of TDbgrid1 .

What I really wanted was to type something in the textbox and on the grid just show me what I typed or the partial text in the user field of the database.

Example: I typed the word to in the text box and I want it to show only words that begin with a without capitalization in the user field of the database. And also when I partially type the text it would show me the words that contain that partial text in the user field of the database.

I hope I've been able to explain my problem. Thanks in advance.

    
asked by anonymous 18.07.2015 / 02:57

1 answer

1


In case what you really want to do, display the data in dbgrid?
In what I understand wants to make a query in the table (table1), in this case it is not possible to do, what can be done is a filter. Home Do you know the basic SQL commands (select, from, where)?
So for the filter the commands that are destined to WHERE can be placed in the filter, for example, if you have a field in the table called CPF, you can put CPF = '12345678912'. Putting on your example:
Table1: NAME, CPF (must be populated)
Then write in the Table1.Filter the expression CPF = '12345678912' and change the Table1.Filtered item to TRUE, run the program, the result is a filter for in the table for the item, if it exists in the table will display. So if you put in the Edit.Text this expression CPF = '12345678912' and in the button click, the following command:

table1.Filtered := false;
table1.Filter   := Edit1.text;
table1.Filtred  := True;

You'll get the result you want.

To start this, does it help you?

    
24.07.2015 / 14:42