FIX: Verify Connection of MS Access Database Connection Changes Current Folder (299912)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

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.

MORE INFORMATION

Steps to Reproduce Behavior


  1. 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
    #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 "MS Access Database"
    MODIFY CONNECTION conn1
    SUSPEND
    ? 'Directory after verify connection: ' + SET('DEFAULT')+ CURDIR()
    RETURN
    
    					
  2. Save and run the program (the name is unimportant).
  3. Click Verify Connection and browse to an Access database. Select the database and click OK.
  4. In the Connection succeeded dialog box, click OK.
  5. 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.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbCodeSnippet kbvfp700fix KB299912