Re: Batchupdates not working as expected
- From: "Chris.Cheney" <Chris.CheneyXXNOSPAMXX@xxxxxxxxx>
- Date: 27 Apr 2007 06:31:45 -0700
"pilmart" <martin.scullion@xxxxxxxxxxxxx> wrote in
news:4631f539$1@xxxxxxxxxxxxxxxxxxxxxx:
"Kevin Frevert" <kevin@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"pilmart" <martin.scullion@xxxxxxxxxxxxx> wrote in messageOK here's what i'm doing I set the dataset properties cluseClient,
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
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
.
- Follow-Ups:
- Re: Batchupdates not working as expected
- From: pilmart
- Re: Batchupdates not working as expected
- References:
- Batchupdates not working as expected
- From: pilmart
- Re: Batchupdates not working as expected
- From: Chris.Cheney
- Re: Batchupdates not working as expected
- From: pilmart
- Re: Batchupdates not working as expected
- From: Kevin Frevert
- Re: Batchupdates not working as expected
- From: pilmart
- Batchupdates not working as expected
- Prev by Date: Re: Batchupdates not working as expected
- Next by Date: Re: Batchupdates not working as expected
- Previous by thread: Re: Batchupdates not working as expected
- Next by thread: Re: Batchupdates not working as expected
- Index(es):
Relevant Pages
|