Re: Batchupdates not working as expected



"pilmart" <martin.scullion@xxxxxxxxxxxxx> wrote in
news:4631f539$1@xxxxxxxxxxxxxxxxxxxxxx:


"Kevin Frevert" <kevin@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"pilmart" <martin.scullion@xxxxxxxxxxxxx> wrote in message
news:4631e0f6$1@xxxxxxxxxxxxxxxxxxxxxxxxx

Am I correct in assuming I need to put the dataset into edit before
changing anything


Yes, before you can edit data inside a dataset, the dataset must be in
Edit mode (calling YourDataSet.Edit();) Same goes for inserting data
(must call the methods Insert or Append).

Good luck,
krf


OK here's what i'm doing I set the dataset properties cluseClient,
ctKeySet, ltBatchoptimistic, commandtext and open the data set.. all
OK so far, I put the dataset into edit, myds.edit, check to ensure
that the state is in dsedit, again all OK so far.

Start to walk the recordset with a while not eof loop and try to amend
a value in the dataset myds.fieldbyname('campaigncode').value := 44;
and lo and behold 'the dataset is not in edit or insert mode' ???, I
checked just before the loop and iwas in dsEdit any idea whats going
on here ???


See the help on the State property of TDataset: "The dataset state
constantly changes as an application processes data" and "Posting or
canceling edits, insertions, or deletions, changes State from its current
state to dsBrowse" and on the Next property "Next posts any changes to
the active record".

So before making changes to (fields in) a record, you should test the
State and, if necessary, call the Edit method.

HTH
.



Relevant Pages

  • Re: can I dynamically increase tso size
    ... While the active copy of data being edited IS kept in memory, if edit recovery is "ON", when the first change is made the original data and any subsequent changes are also kept in an external edit recovery BACKUP dataset until a SAVE is done and the associated edit pending state data is kept in your ISPF profile dataset. ... If your TSO session should time out or otherwise terminate with "extreme prejudice" before a SAVE is done, it is possible to enter Edit Recovery at next TSO logon and pick up where you left off without loss of pending changes. ... Should the edit recovery data set run out of space, this doesn't prevent the edit session from proceeding, it just turns off recovery mode and failure to SAVE changes before termination of the TSO session at that point will result in all edit changes since last SAVE being lost. ...
    (bit.listserv.ibm-main)
  • Re: Pages 2: make a chart from a table?
    ... could edit the data to form the chart, but I want to see this particular data set both as a table and in graphical form. ... but flickered on each mouse-click and crashed reliably after I tried to do some formatting on a sheet I'd imported from Excel. ...
    (uk.comp.sys.mac)
  • Re: Batchupdates not working as expected
    ... Am I correct in assuming I need to put the dataset into edit before ... ctKeySet, ltBatchoptimistic, commandtext and open the data set.. ... that the state is in dsedit, ... Start to walk the recordset with a while not eof loop and try to amend ...
    (borland.public.delphi.database.ado)
  • Why have to use bookmark = recordsetclone.bookmark twice?
    ... consecutively to locate a record in one large data set when we can otherwise ... We have tried canceling any of the event procedures in the edit view form ... The edit view form uses a subform with a parent child ID link. ...
    (microsoft.public.access.forms)
  • Re: Batchupdates not working as expected
    ... all OK so far, I put the dataset into edit, myds.edit, check to ensure that the state is in dsedit, again all OK so far. ... Start to walk the recordset with a while not eof loop and try to amend a value in the dataset myds.fieldbyname.value:= 44; and lo and behold 'the dataset is not in edit or insert mode' ???, I checked just before the loop and iwas in dsEdit any idea whats going on here ??? ... The moment you change the focused record the dataset is posting the changes you have made and then continues to the record you have selected. ... You need to set the dataset in edit mode after you have found the record you want to edit and after finished editing the record you need to call the post method. ...
    (borland.public.delphi.database.ado)