I use a parameterized view to download subsets of records from a table – it is actually a 4 tables join, but only one table is updated. All tables have integer type primary keys, and there are no new records added to the off line tables. There can be any number of downloaded subsets, and it should be possible to download or upload at any time.
The
download form sets the view parameters, then creates the offline files and copies them to the local drive. The code looks like this (I’ve trimmed out all return code checks, progress messages, etc...):
=CREATEOFFLINE('lv_testlog','x:\foxv\wa\PMOFF')
USE x:\foxv\wa\PMOFF IN 0
REPLACE ALL offln WITH .T.
USE x:\foxv\wa\PMOFF ONLINE EXCLUSIVE
=TABLEUPDATE(1,.T.)
USE
COPY FILE x:\foxv\wa\PMOFF.* TO c:\foxv\wa
The <b>upload</b> form does this:
COPY FILE c:\foxv\wa\PMOFF.* TO x:\foxv\wa
USE PMOFF IN 0
REPLACE ALL offln WITH.F.
USE x:\foxv\wa\PMOFF ONLINE EXCLUSIVE
=TABLEUPDATE(1,.T.)
This is my test:
1 - download a set to c:\foxv\wa\PMOFF – using the download form
2 - copy PMOFF files to subdirectory c:\foxv\wa\pm1\
3 - download another set to c:\foxv\wa\PMOFF – using the download form
4 - copy PMOFF files to subdirectory c:\foxv\wa\pm2\
5 – make some changes in the two sets
6 - copy PMOFF files from c:\foxv\wa\pm1\ to c:\foxv\wa\
7 - upload – using the upload form
8 - copy PMOFF files from c:\foxv\wa\pm2\ to c:\foxv\wa\
9 - upload – using the upload form
All works fine first time, I tested only with sets that contain different records.
I try then to download again a set containing records previously updated. All return codes are .T. including the TABLEUPDATE(1,.T.), but this time no updates are done in the source tables. If I open the offline table (I do not drop the offline immediately) it contains some garbage, sometimes less records. I must be doing something illegal...
Any hint will be appreciated.
Doru.
Doru