<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
John,<br><br>Thanks for the suggestion, which I will try at some stage here. In the interim I've got around the problem by using the ADOQuery object instead of the ADOTable object.<br><br>Eric<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: johnkbird@paradise.net.nz<br>To: delphi@listserver.123.net.nz<br>Date: Wed, 16 May 2012 15:17:28 +1200<br>Subject: Re: [DUG] MSSQL DBGrid Refresh<br><br>
<style><!--
.ExternalClass .ecx.hmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
--></style>
<div dir="ltr">
<div style="font-family:'Verdana';color:#000080;font-size:12pt">
<div>You could try</div>
<div> </div>
<div> DBGrid.Datasource:=nil;</div>
<div>
DBGrid.Datasource:=ADOTable1; //this
should force a redisplay, as nilling it clears the grid.</div>
<div> </div>
<div>Thats a tip I saw in the help for KBMemTable (superset of ClientDataSet)
which had all sorts of tips for speeding up loading and displays.
That tip will speed up posting lots of data etc as the DBGrid will not be
showing the updates (which also can cause flickering). Turning it on
afterwards shows the current state after all the updates have finished.</div>
<div> </div>
<div style="font-family:'Verdana';color:#000080;font-size:12pt">John
Bird<br>
<div style="font-style:normal;display:inline;font-family:'Calibri';color:#000000;font-size:small;font-weight:normal;text-decoration:none"></div>
<div style="font:10pt tahoma">
<div style="background:#f5f5f5">
<div style="font-color:black"><b>From:</b> <a title="eaa603@hotmail.com" href="mailto:eaa603@hotmail.com">Eric A</a> </div>
<div><b>Sent:</b> Tuesday, May 15, 2012 8:51 PM</div>
<div><b>To:</b> <a title="delphi@listserver.123.net.nz" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a>
</div>
<div><b>Subject:</b> [DUG] MSSQL DBGrid Refresh</div></div></div>
<div> </div></div>
<div style="font-style:normal;display:inline;font-family:'Calibri';color:#000000;font-size:small;font-weight:normal;text-decoration:none">
<div dir="ltr">I am using a DBGrid with an ADOQuery component for display, with
modifications to table data (edits, deletes, adds) being done using a ADOTable
component. CRUD operations are done using the table methods rather than
raw SQL code. There's a lot of fields in the database table so coding the
operations in SQL would be a pain.<br><br>Despite trying to refresh the data in
the DBGrid by closing then re-opening both the ADOTable and the ADOQuery
component the data in the DBGrid is not updated (unless I exit the application
and restart.<br><br>I've seen this problem mentioned in various postings but
haven't yet seen a solution. Can someone supply the elusive technique to
get the DBGrid data to refresh after the ADOTable data is changed?
<br><br>Eric.<br></div>
<BR><hr>
_______________________________________________<br>NZ Borland Developers Group -
Delphi mailing list<br>Post: delphi@listserver.123.net.nz<br>Admin:
http://delphi.org.nz/mailman/listinfo/delphi<br>Unsubscribe: send an email to
delphi-request@listserver.123.net.nz with Subject:
unsubscribe</div></div></div>
<br>_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request@listserver.123.net.nz with Subject: unsubscribe</div>                                            </div></body>
</html>