Microsoft KB Archive/179381

= PRB: Error Connecting to MS Query with UserConnection Designer =

Article ID: 179381

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q179381



SYMPTOMS
When using the UserConnection Designer, you receive the following message when attempting to build a query:

There was a problem attempting to communicate with MS Query.



CAUSE
The UserConnection Designer cannot find where MS Query is located on the system.



RESOLUTION
Make sure the proper registry key is pointing to where MS Query is located on the system. To do so, you must use RegEdit.

WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

The correct registry key is found at the following location:

HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\VBQuery

The Path value should be set correctly to where MS Query is located. The MS Query executable is named Msqry32.exe.



Steps to Reproduce
 Launch Regedit.exe (click Run on the Start menu, choose REGEDIT, and click OK). Go to the HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\VBQuery key. This key has two data values. Edit the "Path" value to make it invalid (for example, change the name of Msqry32.exe to Msqry3.exe). Start Visual Basic and select a standard EXE. Click Add ActiveX Designer on the Project menu, and select "Microsoft UserConnection." When the UserConnection property page appears, select "User DNS-Less Connection String."</li> Under "ODBC Driver," select "Microsoft Access Driver (*.mdb)" and click OK.</li> Under the UserConnections form, right-click UserConnection1 and select "Insert Query."</li> When the ODBC Microsoft Access 97 Setup dialog box appears, click OK.</li> When the Select Database dialog box appears, choose the "NWIND.MDB" database, and click OK.</li> When the Query1 dialog box appears, click the "Based On User-Defined SQL" option.</li> Type in the SQL statement "Select * from customers" in the text box, then click the "Build" button.

Visual Basic will hang for a few seconds, one of the following will happen:

<ul> You will receive the following message:

There was a problem attempting to communicate with MS Query.

</li> Your SQL statement will be erased.</li></ul> </li> Edit the HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\VBQuery key back to its original value.</li> Repeat steps 4-12, and MS Query will launch properly.</li></ol>

Additional query words: user connection msquery

Keywords: kbprb KB179381

-

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

© Microsoft Corporation. All rights reserved.