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

ID: Q229612


The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, version 6.0
  • Microsoft English Query, version 7.0


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. Click the file names below to download the files:

AdoDataGrid.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Description of Important Files:


Dbinter.cpp: English Query module to execute and display SQL languge.

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

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

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

MfcequiDlg.cpp: Main dialog box for a simple 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 MFCUI C++ RDO English Query sample which ships with the SQL Server 7.0 CD.

Refer to the following KB article for more information on how to use DataGrid Control with ADO in Visual C++:
Q229029 SAMPLE: AdoDataGrid.exe Demonstrates Using ADO with DataGrid

Steps to run the sample:


  1. Build and run Mfcequi.exe.


  2. Specify an EQ application (.eqc) file and a question (.eqq) file in the welcome dialog box. You can use Pubs.eqc or NorthWind.eqc sample EQ files which are installed by EQ in samples folder.


  3. Click Start Aplication in the welcome dialog box.


  4. Choose an SQL Server 7.0 data source in the ODBC administrator dialog box which is displayed when you click Start Aplication.


  5. Enter an English sentence to query on the main query dialog box. For example, enter the following query for pubs database if you have chosen Pubs.eqc in step 2.

    How many authors live in Oakland ?


  6. Click Submit to run the query. English Query will parse the English statment to generate SQL language. The application uses ADO to submit the SQL statement to SQL Server. DataGrid is used to display the results. Click Show SQL to see SQL language command sent to SQL Server.



REFERENCES

For additional information on the EQ Object Model used in the sample, please search the English Query Help Online with the words "Object Model".


Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

Additional query words: kbsample kbfile

Keywords : kbfile kbsample kbDatabase kbEngQuery kbGrpVCDB
Version : NT:7.0; winnt:6.0
Platform : NT winnt
Issue type :


Last Reviewed: December 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.