Microsoft KB Archive/299912

= FIX: Verify Connection of MS Access Database Connection Changes Current Folder =

Article ID: 299912

Article Last Modified on 10/16/2002

-

APPLIES TO


 * 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 Q299912



SYMPTOMS
When you verify a connection to an Access database using the Connection Designer, the current folder may change to the folder that contains the Access database.



STATUS
This problem was corrected in Visual FoxPro version 7.0 for Windows.



Steps to Reproduce Behavior
  In Visual FoxPro (VFP) 5.0 or 6.0, paste the following code in a new program: *!* Q299912 FIX: Verify Connection Of MS Access Database Connection Changes Current Directory CLEAR
 * 1) DEFINE DBCNAME 'testdb'

CLOSE DATA ALL DELETE FILE DBCNAME+'.dbc' DELETE FILE DBCNAME+'.dc?'

CREATE DATABASE DBCNAME ? 'Directory before verify connection: ' + SET('DEFAULT')+ CURDIR CREATE CONNECTION conn1 DATASOURCE &quot;MS Access Database&quot; MODIFY CONNECTION conn1 SUSPEND ? 'Directory after verify connection: ' + SET('DEFAULT')+ CURDIR RETURN

 Save and run the program (the name is unimportant). Click Verify Connection and browse to an Access database. Select the database and click OK. In the Connection succeeded dialog box, click OK. Press CTRL+M to resume execution of the program. The current drive and folder for both before and after the connection was verified appear on the screen. The current folder changes to the location of the Access database.

Keywords: kbbug kbfix kbcodesnippet kbvfp700fix KB299912

-

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

© Microsoft Corporation. All rights reserved.