9 |
The bA Fox Developer Newsletter
Multi-User
(Con’t from page 8)
enddo
*_
Process each modified record.
for InEach
=
I to InCount
*_
Go to the record we had modified.
go (laRecNo[InEach])
*_
If the state of the RECORD is 2
*_
(meaning we are deleting this record)
or 3 (meaning we have added this record),
*_
then we don’t need to worry about any
*_
changes that someone else made.
Otherwise, it is an existing record that
*_
we have modified so we need to go through
each FIELD to see if we have changed it.
Note: If a previous user has Just deleted
*_
the record that we are updating, then we
*_
will “undelete” the record. This is by design.
If
(
getfldstate(O)
<>
2)
and
(
getfldstate(O) <>3
for lnFieldNum
=
I to fcount0
*_
If we have changed this field,
*_
then keep our value. Otherwise,
check to see if the current value
*_
(on the actual table, not our buffer)
*_
is different than what we currently
*_
have. If so, then replace the value
of this field (in our buffer) with
the current value from the table.
if
(
getfldstate(lnFieldNum) <>2)
lcField
=
alltrim(alias0)
+
“.“‘
+
alltrim(field(lnFieldNum))
if &IcField
<>
(curval(fleld(lnFieldNum)))
replace (field(lnFieldNiim)) with (curval(fietd(lnFieldNum)))
endif
endif
endfor
endif
endfor
*_
All the rows in our buffer now have all
—
current data plus our changes, so write the
*_ buffered rows to the table forcing the update.
*_
If the table is in a database container, then
*_
we can use transaction processing so if we
cannot update one of the rows, then we don’t
*_
do any of them. For free tables, we cannot
*_
do transaction processing.
*_
NOTE: An error should only occur if a user
has made a change to the same row we are
*_
updating and that user is NOT using table
—
buffering. If all users are using table
*_
buffering, then we should not get any errors.
if not empty(cursorgetprop(”database”))
begin transaction
110K
=
tableupdate(1, .T.)
if 110K
end transaction
else
rollback
(Con’t, next column)
May 2000
MSDN
(Con? from page 7)
TechNet events.
Offered:
May 18, 1 :00-4:3Opm, Microsoft Santa Monica Office, event
code 30241
May 23, 1 :00-4:3Opm, La Jolla Hyatt, event code 30320
Complete description and registration available on:
http://www.microsoft.com/socal/developer/biztalk2000.htm
Hot Ti PS
(Con? from page 7)
you’ve finished debugging your report, comment out the
MODIFY REPORT tine, and un-comment the REPORT FORM
line.
(Ed.Note: Barbara Peisch is the principal of Peisch Custom
Software, and the TreasurerofFPDN San Diego.
<www.peisch.com>)
Multi-User
(Con? from prey, column)
=messagebox(”The file you are trying to”
+
“update Is currently”
+
chr(13);
+
“being used by someone else.”
+
chr(13);
+
chr(13)
+
“Your changes could not be”;
+
“
saved at this time.”,;
16,
“Could not save changes...”)
endif
else
=
tableupdate(1, .T.)
endif
(Con?, page 6)
It Can’t Get Any Easier......
We’ve come up with an easy way to submit articles to the
L.A
Fox DeveloperNewsietter
one that has been overlooked for
a tong time.
You can submit your articles to Barry Lee at CIS# 72723,3422
on Compuserve,
orbrlee@earthllnk.net.
These articles can be on any FoxPro-related topic, whether it
concerns a new technique you’ve discovered, a certain develop-
ment technique you may favor over others, book reviews, etc.
Editor reserves the right to edit or offer constructive comments
concerning submitted articles and accepted articles shalt be
considered to be in the public domain.
The quality of this newsletter really depends on the members
that support it, not just read it. And I think we’d all be surprised
by the useful information that could be circulated around the
membership.
So.
How ‘bout it?
Page 9
|
9 |