Microsoft KB Archive/229612

= SAMPLE: Mfceqado.exe Shows How to Use English Query with MFC and ADO =

Article ID: 229612

Article Last Modified on 11/23/2006

-

APPLIES TO


 * Microsoft Visual C++ .NET 2002 Standard Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft English Query 7.0
 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6

-



This article was previously published under Q229612



SUMMARY
Mfceqado.exe is an English Query ADO Visual C++ sample that uses ADO in a Visual C++ MFC application to query SQL Server statements generated by the English Query engine. The sample uses DataGrid Control version 6.0 (OLEDB) to display the results.



MORE INFORMATION
The following files are available for download from the Microsoft Download Center:

Download the MfcEqAdo.exe package now. For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Description of Important Files
Dbinter.cpp: English Query module to execute and display SQL languge.

HistoryDlg.cpp: English Query file that implements History and Suggested Questions dialog box.

ListClarifyDlg.cpp: English Query file that implements List Clarification dialog box.

Mfcequi.cpp: A front-end UI for English query.

MfcequiDlg.cpp: Main dialog box for a front-end UI for English Query.

Nlinter.cpp: Interface to English Query Engine Object Model.

ListClarifyDlg.cpp: Implements Query Window dialog box.

ShowSQLDlg.cpp: Implements Show SQL dialog box.

The English Query code used in this sample is very similar to the MFCUI C++ Remote Data Objects (RDO) English Query sample that ships with the SQL Server 7.0 CD-ROM.

Refer to the following Microsoft Knowledge Base article for more information on how to use DataGrid Control with ADO in Visual C++:

229029 SAMPLE: AdoDataGrid.exe Demonstrates Using ADO with DataGrid

Steps to Run Sample

 * 1) Build and run Mfcequi.exe.
 * 2) Specify an English Query (EQ) application (.eqc) file and a question (.eqq) file in the Welcome dialog box. You can use either the Pubs.eqc or NorthWind.eqc sample EQ files that are installed by EQ in the samples folder.
 * 3) Click Start Application in the Welcome dialog box.
 * 4) Choose a SQL Server 7.0 data source in the ODBC Administrator dialog box that displays when you click Start Application.
 * 5) Enter an English sentence to query into the main query dialog box. For example, enter the following query for the pubs database if you select Pubs.eqc in step 2:

How many authors live in Oakland ?
 * 1) Click Submit to run the query. The English Query parses the English statment to generate SQL language. The application uses ADO to submit the SQL statement to SQL Server. The DataGrid displays the results. Click Show SQL to see SQL language command sent to SQL Server.

