As farr as I know Dictionary.update should perform the same operation as File Compact.
I have a separate application that performs only update operation during office off hour as follows.
This script is an autoexec
'This will copy some tables from WINAVA to AVANTAGE
'and change the names of the tables
---------------------------------------
file_copy("D:|apps|winava|avantage|avava|client.dbf","D:|apps|avantage|vaclient.dbf")
file_copy("D:|apps|winava|avantage|avava|fourni.dbf","D:|apps|avantage|vafourni.dbf")
file_copy("D:|apps|winava|avantage|avatv|client.dbf","D:|apps|avantage|tvclient.dbf")
file_copy("D:|apps|winava|avantage|avatv|fourni.dbf","D:|apps|avantage|tvfourni.dbf")
file_copy("D:|pps|winava|avantage|avava|factma.dbf","D:|apps|avantage|vafactma.dbf")
file_copy("D:|apps|winava|avantage|avava|pybbil.dbf","D:|apps|avantage|vapybbil.dbf")
'-------------------------------
'This will reconstitute the accented characters
'in three tables
'-----------------------------
tbl = table.open("vaclient")
update.fields = 3
update.field1 = "cnom"
update.expr1 = "oem_to_ansi(cnom)"
update.field2 = "cadr"
update.expr2 = "oem_to_ansi(cadr)"
update.field3 = "cvil"
update.expr3 = "oem_to_ansi(cvil)"
tbl.update()
tbl = table.open("vafourni")
update.fields = 3
update.field1 = "fnom"
update.expr1 = "oem_to_ansi(fnom)"
update.field2 = "fadr"
update.expr2 = "oem_to_ansi(fadr)"
update.field3 = "fvil"
update.expr3 = "oem_to_ansi(fvil)"
tbl.update()
tbl = table.open("vafactma")
update.fields = 3
update.field1 = "ffcnom"
update.expr1 = "oem_to_ansi(ffcnom)"
update.field2 = "ffcadr"
update.expr2 = "oem_to_ansi(ffcadr)"
update.field3 = "ffcvil"
update.expr3 = "oem_to_ansi(ffcvil)"
tbl.update()
'This should perform the same as File Compact on LVA
'---------------------------------------------
dictionary.update("D:appsavantage*.dbf")
dictionary.update("D:appsavantage*.ddd")
dictionary.update("D:appslva*.dbf")
dictionary.update("D:appslva*.ddd")
dictionary.update("D:appslva*.set")
a5.close()
Note: "|" = backslash
The files in D:|apps|avantage| are the lookup tables for
D:|apps|lva|
From a remote station, after the update operation is completed, if I look directly at the tables all the new records have been transfered correctly, all the accented characters are correct, but when I use the lookup operation from a field in a form, the new records are not available.
Then if I perform a File Compact the lookup operation works fine and all records are available.
I guess I am missing something when I do the Dictionary.update
Should I update other files than only the "DBF", "DDD", and "SET" ?
Thanks
I have a separate application that performs only update operation during office off hour as follows.
This script is an autoexec
'This will copy some tables from WINAVA to AVANTAGE
'and change the names of the tables
---------------------------------------
file_copy("D:|apps|winava|avantage|avava|client.dbf","D:|apps|avantage|vaclient.dbf")
file_copy("D:|apps|winava|avantage|avava|fourni.dbf","D:|apps|avantage|vafourni.dbf")
file_copy("D:|apps|winava|avantage|avatv|client.dbf","D:|apps|avantage|tvclient.dbf")
file_copy("D:|apps|winava|avantage|avatv|fourni.dbf","D:|apps|avantage|tvfourni.dbf")
file_copy("D:|pps|winava|avantage|avava|factma.dbf","D:|apps|avantage|vafactma.dbf")
file_copy("D:|apps|winava|avantage|avava|pybbil.dbf","D:|apps|avantage|vapybbil.dbf")
'-------------------------------
'This will reconstitute the accented characters
'in three tables
'-----------------------------
tbl = table.open("vaclient")
update.fields = 3
update.field1 = "cnom"
update.expr1 = "oem_to_ansi(cnom)"
update.field2 = "cadr"
update.expr2 = "oem_to_ansi(cadr)"
update.field3 = "cvil"
update.expr3 = "oem_to_ansi(cvil)"
tbl.update()
tbl = table.open("vafourni")
update.fields = 3
update.field1 = "fnom"
update.expr1 = "oem_to_ansi(fnom)"
update.field2 = "fadr"
update.expr2 = "oem_to_ansi(fadr)"
update.field3 = "fvil"
update.expr3 = "oem_to_ansi(fvil)"
tbl.update()
tbl = table.open("vafactma")
update.fields = 3
update.field1 = "ffcnom"
update.expr1 = "oem_to_ansi(ffcnom)"
update.field2 = "ffcadr"
update.expr2 = "oem_to_ansi(ffcadr)"
update.field3 = "ffcvil"
update.expr3 = "oem_to_ansi(ffcvil)"
tbl.update()
'This should perform the same as File Compact on LVA
'---------------------------------------------
dictionary.update("D:appsavantage*.dbf")
dictionary.update("D:appsavantage*.ddd")
dictionary.update("D:appslva*.dbf")
dictionary.update("D:appslva*.ddd")
dictionary.update("D:appslva*.set")
a5.close()
Note: "|" = backslash
The files in D:|apps|avantage| are the lookup tables for
D:|apps|lva|
From a remote station, after the update operation is completed, if I look directly at the tables all the new records have been transfered correctly, all the accented characters are correct, but when I use the lookup operation from a field in a form, the new records are not available.
Then if I perform a File Compact the lookup operation works fine and all records are available.
I guess I am missing something when I do the Dictionary.update
Should I update other files than only the "DBF", "DDD", and "SET" ?
Thanks
Comment