Microsoft KB Archive/308215

= PRB: VFP ODBC Driver Causes Various Errors in Microsoft Products =

Article ID: 308215

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Open Database Connectivity Driver for Visual FoxPro 1.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 2.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 3.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 4.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 5.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 1.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 5.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 5.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 5.0

-



This article was previously published under Q308215



SYMPTOMS
When you use the Visual FoxPro ODBC driver to retrieve data, you may receive the following error messages in various Microsoft products:  If you use Visual FoxPro to retrieve data from a FoxPro table using the Remote View Designer, you receive the following error message:

Connectivity Error: [Microsoft] [ODBC Visual FoxPro Driver] Invalid cursor state.

 If you use Microsoft Access to link or import to the FoxPro table, you receive the following error message:

ODBC--Call Failed.

 If you access the FoxPro table using Microsoft Word or Microsoft Excel, you receive the following error message:

General ODBC Error.

Followed by:

Couldn't read this file.

NOTE: This error assumes that Word and Excel are using the Microsoft Query interface to retrieve the data.

If you use a Visual Basic 6.0 application to access Visual FoxPro data, you may receive the following error message:

ODBC Error: Cannot open file \ \*.tmp

NOTE: Where represents the drive and represents the folder that Windows uses to store its temp files.



CAUSE
These errors occur because the System attribute is set at the TEMP folder of the computer. This error seems to occur only on Microsoft Windows NT 4.0, Microsoft Windows 2000, and Microsoft Windows XP operating systems.



RESOLUTION
From a command prompt, issue the ATTRIB -S C:\WINNT\TEMP command to remove the System attribute from the TEMP folder. This assumes that the C:\WINNT\TEMP folder is the default for the TEMP and TMP environment variables. To determine this, right-click the My Computer icon on the desktop, click Properties, click Advanced, and then click Environment Variables. Look at the TEMP and TMP variables in the System Variables list box to determine which folder the variables are pointing to and then issue the ATTRIB command on this folder.



Steps to Reproduce the Behavior
 Use the MS-DOS ATTRIB command to set the System attribute for the TEMP folder. For example, the syntax for a folder that is named &quot;temp&quot; on drive C would be as follows:

ATTRIB +S c:\temp

 Use the Visual FoxPro ODBC driver to create a data source name (DSN) in the ODBC Administrator, and then point it to a Visual FoxPro table or a database container.</li> Use the visual interface of any of the Microsoft products that are listed earlier to access the DSN that is pointing to the FoxPro table or database container.</li> After selecting the DSN, the error appears, and the data will not be retrieved.</li></ol>

Keywords: kbprb KB308215

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.