Solved

Delphi Programming question

Posted on 1997-09-24
1
142 Views
Last Modified: 2010-04-04
Hi,

My problem is that I've got a database with SQL trigger.
So, when I add a new record to the database, the new record
can't be seen in the DBGRID comp. linked to that database.
When I refresh  the database, then the new record can be see. The question is is there any chance to see the newly
added record without freshing the whole database?
Imagine the database contains 50.000 record. It lasts a lot
of time for refreshing.
So can be refreshed only the new record or not?
0
Comment
Question by:bandi081497
[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
1 Comment
 
LVL 1

Accepted Solution

by:
anilms earned 40 total points
ID: 1346154
1. Use the TQuery component to populate the DBGrid (instead of TTable). Have an SQL statement for populating the DBGrid.

2. To refresh the DBGrid, you have to call the close and open methods of the TQuery component. Ex:
QueryInvoice.close; QueryInvoice.open;

3. You can do this periodically by using a timer control. In fact security trading systems use this methodology to keep screens
upto date. Of course, if you are using MS SQL Server, you could
use an ODS service which would send a message to the Delphi program to close and open the TQuery component.
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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

717 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