||Re: Update syntax
Mervyn Bick <firstname.lastname@example.org>
||Sat, 13 Feb 2021 17:24:28 +0200
On 2021/02/13 16:08, Tom wrote:
> You can proceed to more important things gentlemen. You have once again
> hit the nail squarely on the head Mervyn. The quotes around DemoDataID
> value were all that were necessary for writing the data (see Msgbox3
> attached). It was really annoying to have the 'INSERT INTO' portion of
> the code working and not be able to get the 'UPDATE SET' syntax correct.
> Now, both work just fine.
Now that both the INSERT and UPDATE are working there is one other
little thing to keep in mind.
Making a query active creates a rowset in memory. If you add or change
a value using oRowset.fields['whatever'].value = "something" and then
execute oRowset.save() the new value is placed in the rowset in memoty
and reflects in any datalinked controls such as a grid immediately. The
new value is, depending on various factors including possible hardware
settings, not necessarily written to the table on disk immediately. The
value may be held in a cache, usually for only a very short while, until
the operating system gets around to it.
By using the localSQL INSERT and UPDATE commands the rowset in memory is
bypassed and the data is written directly into the table. For your
application to be able to see the changed value(s) you will need to
execute the query's requery() method after the INSERT or UPDATE.