If you use VFPXTab to calculate cross-tabs in VFP, you have to modify it to make it work properly in a multi-user environment.
We have a client with West-Wind Web Connection on their server, and one of their dashboard widgets used a cross-tab of some data. Periodically an error would get automatically emailed to us indicating a “File In Use.” Closer inspection of that error showed that it was trying to delete the temporary file named xtabtemp.dbf.
To fix this, simply add a property to the GenXTab class in vfpxtab.prg and initialize it to a random string:
cTempFile = FORCEEXT(SYS(2015),’dbf’)
Then replace all hardcoded instances of ‘xtabtemp’ with either (This.cTempFile) or (JUSTPATH(This.cTempFile)), depending on whether they want the alias or the full filename. It’s a simple fix, and you should just do it now in case you compile an EXE that gets put out live in a multi-user situation sometime.
Leave a Reply