Microsoft KB Archive/192979

= PRB: VFPODBC Driver Ignores Path in DSN When Executing SQL =

Article ID: 192979

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q192979



SYMPTOMS
After you connect to a particular database, or point to a free table directory, the Visual FoxPro ODBC driver ignores the path specified in the Datasource.



RESOLUTION
In the SQL statement, use the full drive and path where the table is to be stored. For example: CREATE TABLE 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MSDN98\98VS\1033\ SAMPLES\VFP\DATA\MYTEST1' (FLD1 C(10),FLD2 N(6.2)) NOTE: With MSQuery, if you are using a path similar to the preceding example, you must use a command similar to the following: CREATE TABLE d:\PROGRA~1\MICROS~1\MSDN98\98VS\1033\SAMPLES\vfp98\DATA\ MYTEST1' (FLD1 C(10),FLD2 N(6.2))



STATUS
This behavior is by design.



MORE INFORMATION
The driver uses the current directory of the calling application for any work it must perform.

Steps to Reproduce Behavior
The following sample uses MSQUERY to show the behavior. Please note that MSQuery is not unique in this behavior. Any software that can issue a Create Table SQL command through an ODBC driver can be used to reproduce this behavior.

 Create a Data Source using the Microsoft Visual FoxPro Driver that references the TestData.dbc. TestData.dbc is located in the Samples\Data (Samples\VFP\Data of the Visual FoxPro directory. In MSQuery, click the Execute SQL option located on the File menu.  Copy and paste the following SQL string into the SQL Statement window:       CREATE TABLE MYTEST1 (FLD1 C(10),FLD2 N(6,2))                             Click the Datasources button and select the datasource you created in Step 1. Click the Execute button. Click the Start menu, point to Find and then click Find Files. In the Find:All Files dialog box, type MyTest1.dbf in the Named text box. Click the Find button. Note that the MyTest1.dbf file is not in the Data directory with the TestData table.</li></ol>

Keywords: kbdatabase kbprb kbcode KB192979

-

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

© Microsoft Corporation. All rights reserved.