How to use ATL OLE DB Consumer to perform a full-text query with Visual C++ (198486)
The information in this article applies to:
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft SQL Server 7.0
This article was previously published under Q198486 Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. SUMMARY This sample code below is an OLE DB Consumer Application
that demonstrates how to perform a full-text query with the Visual C++ 6.0 OLE
DB Consumer Templates to retrieve data from the SQL Server NorthWind database
using SQLOLEDB Provider.
Full-text indexes can be administered using
either the SQL Server Enterprise Manager or stored procedures. Before you run
this sample, run the FullText Indexing Wizard (in SQL Server's Enterprise
Manager) on the NorthWind.Products table, and index the ProductName column.
Populate the index by right-clicking its name under the Full-text catalogs
folder in the NorthWind database. For more information, see SQL Books
Online.
Briefly, create a .cpp file using the code given below in
Visual C++ 6.0 and compile/build from Build menu (it will prompt for creating a
new workspace--this should build and run without adding new code). Change the
initialization properties to connect to your SQL 7.0 server. REFERENCES For more details on SQL 7.0 full-text search, please refer
to SQL 7.0 Books Online. To learn more about the Accessor used in the
code above, run the ATL Consumer Wizard on the SQL Server 7 NorthWind database,
Products Table.
For more information about the requirements to add OLE DB template support to Visual C++ projects, click the following article number to view the article in the Microsoft Knowledge Base:
190959
PRB: OLE DB Consumer Template Wizard requires ATL project
Modification Type: | Major | Last Reviewed: | 1/11/2006 |
---|
Keywords: | kbDatabase kbDTL kbhowto KB198486 kbAudDeveloper |
---|
|