<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I may be way off and this is a long shot, but I remember many years ago the Delphi TTable object (at least I think it was the TTable object) having a TransIsolation (transaction isolation) property that affected when you see changes to the underlying data. Changing the value of that property may help with your issue if you still want to use the TADOTable instead.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> delphi-bounces@listserver.123.net.nz [mailto:delphi-bounces@listserver.123.net.nz] <b>On Behalf Of </b>Eric A<br><b>Sent:</b> Wednesday, 16 May 2012 11:43 a.m.<br><b>To:</b> Delphi ListServer<br><b>Subject:</b> Re: [DUG] MSSQL DBGrid Refresh<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Thanks for the response, Rob.<br><br>Interestingly, I have just changed from using the TADOTable objects for adding/deleting/editing the database table data and have instead now implemented those functions in TADOQuery objects. The problem appears to have been solved. I just follow the TADOQuery methods with either an ADOQuery.Requery([]) method invoation or the sequence of ADOQuery.Close then ADOQuery.Open (either has the the desired result).<br><br>In this case its a pretty straightforward small application with only two distinct tables, i.e. there are no Master/Detail relationships to worry about.<br><br>Normally, for more complex databases (eg with relationships between tables) I would use the SQL approach as you have intimated.<br><br>Eric<br><br><br><o:p></o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><hr size=2 width="100%" align=center id=stopSpelling></span></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Date: Wed, 16 May 2012 09:49:30 +1200<br>From: <a href="mailto:rob@chreos.co.nz">rob@chreos.co.nz</a><br>To: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Subject: Re: [DUG] MSSQL DBGrid Refresh<br><br>Hi<br><br>I don't use the ADO components much but it sounds like a caching issue. I would definately NOT use table methods and do it all from SQL. Its much cleaner that way and you can see exactly what's going on, rather than letting a table component do the magic or running its own queries !<br><br>Cheers<br>Rob<br><br><br>On 16/05/2012 9:39 a.m., Eric A wrote: <o:p></o:p></span></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>No, I've tried the Requery method and as I understand it the Requery method is effectively doing the same as the Open and Close sequence, i.e. forcing the select statement to be reissued against the database.<br><br>For record deletion I call the nbDelete button method on the DBNavigator followed by closing/opening the ADOQuery and that does result in the data being refreshed in the DGBrid. <br><br>For adding and editing records I am using the ADOTable "Append"/"Edit" and "Post" methods on the table followed by closing/opening the ADOQuery (or ADOQuery.Requery) and for some reason (which presently escapes me) the data is not refreshed in the grid.<br><br>The question is should I even be using the ADOTable and would I better off just issuing raw SQL commands via the ADOCommand or similar component?<br><br>Eric<o:p></o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><hr size=2 width="100%" align=center id=ecxstopSpelling></span></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Date: Tue, 15 May 2012 21:09:31 +1200<br>From: <a href="mailto:vikas.image@gmail.com">vikas.image@gmail.com</a><br>To: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Subject: Re: [DUG] MSSQL DBGrid Refresh<br><br>Hi Eric, <o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>With AdoQuery you can try Requery method.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>This article might help.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><a href="http://edn.embarcadero.com/article/23011" target="_blank">http://edn.embarcadero.com/article/23011</a>.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Hope it helps<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Regards<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Vik<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>On Tue, May 15, 2012 at 8:51 PM, Eric A <<a href="mailto:eaa603@hotmail.com">eaa603@hotmail.com</a>> wrote:<br><br><o:p></o:p></span></p><div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>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><span style='color:#888888'><br>Eric.</span><o:p></o:p></span></p></div></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>_______________________________________________<br>NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br><br clear=all><o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>-- <br> vikas<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a> Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a> Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<o:p></o:p></span></p></div></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br><br><o:p></o:p></span></p><pre>_______________________________________________<o:p></o:p></pre><pre>NZ Borland Developers Group - Delphi mailing list<o:p></o:p></pre><pre>Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><o:p></o:p></pre><pre>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><o:p></o:p></pre><pre>Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<o:p></o:p></pre><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br><br><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>No virus found in this message.<br>Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>Version: 2012.0.2176 / Virus Database: 2425/5000 - Release Date: 05/15/12<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a> Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a> Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<o:p></o:p></span></p></div></div></div></body></html>