Solved

Refresh a dbgrid

Posted on 1998-04-06
3
193 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank Bijoy,I got it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now