Solved

Refresh a dbgrid

Posted on 1998-04-06
3
197 Views
Last Modified: 2010-04-06
The codes are like as:

>   Query1->Close();
>   Query1->SQL->Clear();
>   Query1->SQL->Add("insert into supply(suppno,suppname)\
>                     values ('255222','11xx')");
>   Query1->Close();
>   Query1->SQL->Clear();
>   Query1->SQL->Add("select * from supply");
>   Query1->Prepare();
>   Query1->Active = true;

But the dbgrid of the table was nort refreshed.
Need any suggestion. Thank you.
0
Comment
Question by:mathematics
3 Comments
 
LVL 1

Accepted Solution

by:
extreme earned 100 total points
ID: 1361309
I suppose you have a TTable connected with that DBGrid. In fact, if you modify the Query, that don't modify the table. If you want to have the results of the query in a DBGrid, then you have to connect the DBGrid with a DataSource connected to the query.
0
 

Expert Comment

by:bijoyn
ID: 1361310
Hi ,

I noticed that in the above code that u have specified. U are not doing a Query1.ExecSQL to add the inserted record. Have u forgotten to do it or have u just slipped while typing the code ?????. Do a Query1.ExecSQL to solve the problem

Cheers,

Bijoy
0
 

Author Comment

by:mathematics
ID: 1361311
Thank Bijoy,I got it.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question