Microsoft KB Archive/191325

= FIX: Connection Designer Closes if Verify Connection Fails =

Article ID: 191325

Article Last Modified on 3/3/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Data Access Components 2.5

-



This article was previously published under Q191325



SYMPTOMS
When you create or edit a connection in the Connection Designer and try to test the connection with the Verify Connection button, the Connection Designer closes.



RESOLUTION
As a work around, you can save your connection within the Connection Designer before clicking the Verify Connection button. You can accomplish this by clicking the OK button in the Connection Designer, giving the connection a name if you have not yet saved it, and then click the Modify button in the Connections dialog box after selecting the connection from the list.



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.



Steps to Reproduce Behavior
  Run the following code from a program (.prg) file: CLOSE DATA ALL SET SAFETY OFF CREATE DATABASE testdb CREATE TABLE testtab (f1 c(10), f2 N(10)) CLOSE DATABASE ALL SET SAFETY ON     OPEN DATABASE testdb EXCLUSIVE MODI DATABASE testdb NOWAIT KEYBOARD '{shift+f10}{o}{alt+n}{alt+n}'  In the ODBC Data Source Administrator, click the System DSN tab and then click the Add button. From the list in the Create New Data Source dialog box, select "Microsoft Visual FoxPro Driver" and then click the Finish button. In the ODBC Visual FoxPro Setup dialog box, enter a data source name, such as "Vfptest", without the quotes. Enter the path to the .dbc you created in the program in Step 1. This, in effect, will be the default directory when the program runs, and the file will be called Testdb.dbc. Click OK then click OK again.</li> You will now be back in the Connection Designer. Select the data source you just created from the Data Source drop-down.</li> Click the Verify Connection button.</li></ol>

The Connection Designer closes. The connection fails because Testdb.dbc was opened exclusively by the program. If the database opens shared, the connection succeeds.

<div class="references_section">