FIX: TMP File Errors If ALTER TABLE Runs Same Time As ODBC DLL (185655)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Data Access Components 2.5
This article was previously published under Q185655 SYMPTOMS
If another process is using the VFP ODBC driver and DLL at the same time as
the program is running in Visual FoxPro, and the temp file location is the
same for Visual FoxPro as it is for the operating system, then one of the
following error messages may occur:
[Microsoft][ODBC Visual FoxPro Driver] Field B does not accept null
values. Error calling sqlcolumns in test_odbc. DLLState is: 23000.
[Microsoft][ODBC Visual FoxPro Driver] Cannot open file
f:\temp\62616984.tmp. Error calling sqlcolumns in test_odbc.
DLLState is: S1000
[Microsoft][ODBC Visual FoxPro Driver] Data type mismatch.
Error calling sqlcolumns in test_odbc. DLL State is 22005.
NOTE: test_odbc refers to an ODBC data source name.
Furthermore, if two instances of Visual FoxPro 3.0x or 5.0x are running at
the same time and are they are creating temp files in the same location,
the following errors may occur:
File access is denied.
File 'd:\temp\64382453.tmp' does not exist.
Not a table.
Alias <aliasname> is not found.
Error writing to file.
CAUSE
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.
Most often, the temporary files are used and closed before they are ever
created on the disk.
Visual FoxPro creates temporary files that have names like 64382453.tmp.
The files are created in the location designated by the parameters given
for TMPFILES=, EDITWORK=, PROGWORK=, and SORTWORK= in the Visual FoxPro
configuration file, Config.fpw, by default or in the operating system's SET
TEMP parameter location.
RESOLUTION
Each session of Visual FoxPro needs to have a separate location for its
temporary files. The steps to implement this are given below.
- Create a subdirectory on the disk for Visual FoxPro's temporary files
similar to D:\vfptemp. Make sure that each session of Visual FoxPro has
a unique temporary file location.
- Create a Config.fpw for each session with parameters that point to the
temporary file location:
TMPFILES=D:\vfptemp
EDITWORK=D:\vfptemp
PROGWORK=D:\vfptemp
SORTWORK=D:\vfptemp
- Append a -c parameter to the Visual FoxPro startup command line for each
session to specify the Config.fpw file to use. An example is below:
"D:\Visual Studio\VFP\VFP.EXE" "-cd:\Visual Studio\config.fpw"
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This has been corrected in Visual FoxPro
6.0.
REFERENCES
Microsoft FoxPro Help; search on: "temporary files"
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Perry
Newton, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 2/17/2005 |
---|
Keywords: | kbbug kbfix KB185655 |
---|
|