?
Solved

Refresh a dbgrid

Posted on 1998-04-06
3
Medium Priority
?
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
extreme earned 400 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

Independent Software Vendors: 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

764 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