{"id":53,"date":"2007-05-08T15:44:43","date_gmt":"2007-05-08T13:44:43","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/database-d5d6-error-with-db-access\/"},"modified":"2007-05-11T19:38:37","modified_gmt":"2007-05-11T17:38:37","slug":"database-d5d6-error-with-db-access","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/database-d5d6-error-with-db-access\/","title":{"rendered":"Database: D5\/D6 Error with DB-Access"},"content":{"rendered":"<p><em>Q:<br \/>\n&#8212;-<br \/>\nI have two query connect to DBDemos.<\/p>\n<p>Query1.sql<br \/>\nselect name<br \/>\nfrom country<\/p>\n<p>Query2.sql (connect to query1)<br \/>\nselect *<br \/>\nfrom country<br \/>\nwhere name = :name<\/p>\n<p>Query1 connect  to a DBGrid and Query2 connect to a group of DBEdit.<br \/>\nWhere I scroll Query1 record in DBGrid, Query2 record in DBEdit will<br \/>\nnot change. But when I replace DBEdit to DBGrid and also connect to<br \/>\nQuery2. It WORKS.<\/p>\n<p>This error ever occured in Delphi 5 but solve in Delphi 5 Patch 1.<\/p>\n<p>It is a simple error but a IMPORTANT bug.<br \/>\n<\/em><\/p>\n<p>A:<br \/>\n&#8212;-<br \/>\nChange TFieldDataLink&#8217;s UpdateField to<\/p>\n<p>[code lang=&#8221;delphi&#8221;]procedure TFieldDataLink.UpdateField;<br \/>\nbegin<br \/>\n  SetField(nil);<br \/>\n  if Active and (FFieldName <> &#8221;) then<br \/>\n  begin<br \/>\n    if Assigned(FControl) then<br \/>\n      SetField(GetFieldProperty(DataSource.DataSet, FControl, FFieldName)) else<br \/>\n      SetField(DataSource.DataSet.FieldByName(FFieldName));<br \/>\n  end<br \/>\nend;<br \/>\n[\/code]<\/p>\n<p>and statically link in the changed pas file.  As you noticed this bug was in D5<br \/>\nshipping, fixed in SP1 but for some reason reverted back in D6 to the buggy<br \/>\nversion.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q: &#8212;- I have two query connect to DBDemos. Query1.sql select name from country Query2.sql (connect to query1) select * from country where&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[75,80,83],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-R","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/53"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}