I have an application written in ASP Classic and connecting to a FoxPro database which intermittently throws this error message, found in the IIS log file:
14|80004005|[Microsoft][ODBC Visual FoxPro Driver]Unable to create temporary work files.
The line referenced is a SELECT statement against the FoxPro database. The error does not occur every time this particular SELECT statement is run.
The ever-helpful MSDN Article concerning this error suggests that the problem is either due to permissions or to disk space. Permissions are at least semi-functional because the problem doesn't always happen. Disk space is also not a problem as there is enough free space on the drive (8GB) proportional to the size of the database in question (about 500MB).
What else can I look for?
Is the FoxPro ODBC driver cleaning up after itself?
Look in your TEMP folder (defined by the %TEMP%
environment variable, in my case), and you may see a large number of files matching the expression [A-Z0-9]{8}\.TMP
(e.g. LVAK00AQ.TMP
).
Per this ancient tome, FIX: TMP File Errors If ALTER TABLE Runs Same Time As ODBC DLL:
Visual FoxPro and the VFP ODBC driver both use the same naming convention and algorithm for temporary (.tmp) file creation. If both programs run concurrently, there is a conflict in the processes attempting to access the same file or same file name. This conflict creates different error messages.
Visual FoxPro 5.0x uses a tempfile naming scheme based on the system clock. These names are generated for internal use and many times the filename is never actually created on the disk. However, there are many circumstances when FoxPro does create the temporary file on disk, so the name generation scheme could cause two processes or two instances of the run-time in the same process to generate the same temporary file name. If both processes try to create a temporary file on disk later, only the first one succeeds.
In my experience, the file naming pattern is based on a small unit of time, and with the alphanumeric scheme limited to 8 characters, it will start again from 0 within a short period of time (not sure if hours or days).
If the temp file needs to be written to disk, and the file already exists from a previous execution, then instead of overwriting the previous file, the driver will throw the error "Unable to create temporary work files".