﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <description><![CDATA[Comments for How to use AutoInc fields with DataSnap]]></description>
    <title><![CDATA[Comments for How to use AutoInc fields with DataSnap]]></title>
    <link>http://dn.codegear.com/article/20847</link>
    <!-- source: http://dn.codegear.com/article/20847/feed-->
    <dc:date>2008-07-04T20:17:53-07:00</dc:date>
    <item>
      <description><![CDATA[I have also tried a number of different ways to cascade key fields from master-&gt;detail datasets to no avail. My compromise was to handle it in the provider BeforeUpdateRecord something like...if (SourceDS = qryDetail) and not    (VarIsEmpty(DeltaDS.FieldByName('Id').NewValue) or          VarIsNull(DeltaDS.FieldByName('Id').NewValue)) then                   DeltaDS.FieldByName('Id').NewValue :=                             DeltaDS.DataSetField.DataSet.FieldByName('Id').Value;]]></description>
      <title><![CDATA[re: How to use AutoInc fields with MIDAS]]></title>
      <managingEditor>
	 (John Ginn)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=37820</guid>
      <dc:date>2004-11-09T21:36:54-08:00</dc:date>
      <pubDate>2004-11-09T21:36:54-08:00</pubDate>
      <source url="http://dn.codegear.com/article/20847/feed">Comments for How to use AutoInc fields with DataSnap</source>
    </item>
    <item>
      <description><![CDATA[This article is very useful. I frequently had the problem to retrieve the AutoInc value assigned by the database after an Insert. I was looking for months on how to avoid Refresh or RefreshRecord to retrieve an AutoInc value supplied by the database on the Server. This never worked satisfactorily although I had activated the poAutoRefresh and the poPropogateChanges flags on the TProvider component.The decisive hint came from this article. Changes are not sent back automatically to the Client DataSet unless the AutoInc value is assigned to the fields "NewValue" of the DeltaDS. Now it is clear. If the "AutoRefresh" is supported by the database than it works automatically. If not then it is just necessary to ask the database which AutoInc value was assigned and to assign this value in the AfterUpdateRecord event handler of the Provider such as for instancefunction GetIdFromDatabase: Integerbegin    Result := some codeend;Provider_AfterUpdateRecord(....);begin    if (UpdateKind = ukInsert) then with DeltaDS do begin        Edit;        FieldByName('Id').AsInteger := GetIdFromDatabase;        Post;    end;end;]]></description>
      <title><![CDATA[How to use AutoInc fields with MIDAS]]></title>
      <managingEditor>
	 (Sigbert Buchegger)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=37788</guid>
      <dc:date>2004-10-29T01:34:50-07:00</dc:date>
      <pubDate>2004-10-29T01:34:50-07:00</pubDate>
      <source url="http://dn.codegear.com/article/20847/feed">Comments for How to use AutoInc fields with DataSnap</source>
    </item>
    <item>
      <description><![CDATA[It would be nice to have an example using a non-BDE-based Tdataset collection, i.e., ADO, IBX, etc. It seems that, for the most part, all of the nested dataset stuff works without problems with BDE_based database access.With ODAC, I had to set my TOraProvider to hit the dataset, poCascadeUpdates, and doing the autoinc trick (adding dummy sequential PK on autoinc fields) for multiple detail records does add the data, but I can't seem to figure out where to catch the exception raised when the CDS/dataprovider cannot retrieve the detail records, which at this point have the "real" autoinc value from the database.]]></description>
      <title><![CDATA[How to use AutoInc fields with MIDAS]]></title>
      <managingEditor>
	 (corey lawson)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=37616</guid>
      <dc:date>2004-10-03T01:19:02-07:00</dc:date>
      <pubDate>2004-10-03T01:19:02-07:00</pubDate>
      <source url="http://dn.codegear.com/article/20847/feed">Comments for How to use AutoInc fields with DataSnap</source>
    </item>
    <item>
      <description><![CDATA[Yes, the foreign key values seem to be difficult to get from the master to the nested detail dataset. I'm having no luck either.I've set up (D5, ODAC 3.60, InfoPower 3000) something using the TOraDataProvider instead of TDataProvider to popup a "recordviewdialog" (an InfoPower control) in the provider's BeforeUpdateRecord event handler to look at the data in the DeltaDS for the necessary dataset. The value in the Foreign key field for a new detail record is actually not -1, but appears to be null. Also, working with NewValue is not working so well either per the code...*sigh*I even d/l'd the D7 version of midas.dll. I'm definitely missing something...]]></description>
      <title><![CDATA[re: How to use AutoInc fields with MIDAS]]></title>
      <managingEditor>
	 (corey lawson)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=37599</guid>
      <dc:date>2004-09-29T00:20:10-07:00</dc:date>
      <pubDate>2004-09-29T00:20:10-07:00</pubDate>
      <source url="http://dn.codegear.com/article/20847/feed">Comments for How to use AutoInc fields with DataSnap</source>
    </item>
    <item>
      <description><![CDATA[I tried all the possibilities to use autoinc fields but no result yet. First I tried to set the fields as arAutoInc on the TSQLDataset or TSQLTable but nothing. Then I set poAutoRefresh to true on the provider, and no result. So I changed to nested datasets and the result was the same: the detail records are inserted with null foreign keys. In the end there is no easy method to insert into a master/detail form, even if the documentation says it should work.]]></description>
      <title><![CDATA[How to use AutoInc fields with MIDAS]]></title>
      <managingEditor>
	 (Cristian Georgescu)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=34836</guid>
      <dc:date>2003-06-24T07:56:22-07:00</dc:date>
      <pubDate>2003-06-24T07:56:22-07:00</pubDate>
      <source url="http://dn.codegear.com/article/20847/feed">Comments for How to use AutoInc fields with DataSnap</source>
    </item>
    <item>
      <description><![CDATA[I would love to see this article updated for use with ADO components.  These components change the value of the data that us entered with a positive value starting from the number 1 when a post is issued on a ClientDataset (CDS).  When you look for you negative values in the middle tier they are not there.  I cannot find a property that stops the CDS from changing the value autoinc value in the client application.]]></description>
      <title><![CDATA[How to use AutoInc fields with MIDAS / ADO]]></title>
      <managingEditor>
	 (Rafel Coyle)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=33661</guid>
      <dc:date>2002-12-02T09:53:48-08:00</dc:date>
      <pubDate>2002-12-02T09:53:48-08:00</pubDate>
      <source url="http://dn.codegear.com/article/20847/feed">Comments for How to use AutoInc fields with DataSnap</source>
    </item>
    <generator>Atom 1.0 XSLT Transform v1 (http://atom.geekhood.net)</generator>
  </channel>
</rss>