Visual C++ and ADO
Using Microsoft® Visual C++® with ADO allows you to write data access applications for Microsoft SQL Server™ 2000. When developing a SQL Server application, you can:
- Use the #import Compiler COM directive to import the Msado15.dll before using ADO. The directive generates header files containing typedef declarations, smart pointers for interfaces, and enumerated constants. Each interface is encapsulated, or wrapped, in a class. This is the recommended way to program ADO using Visual C++.
- Use the IADORecordBinding interface (also referred to as ADO Visual C++ Extensions), which supports retrieving data into native C/C++ data types without going through a VARIANT data type. It also provides preprocessor macros when using the interface. The interface has methods to associate ADO Recordset fields with C/C++ variables, to add new rows, and to perform updates. This method of programming ADO using Visual C++ is recommended for backward compatibility only.
Visual Studio version 6.0 includes the ADO Data Control and other databound controls that you can use to design Microsoft Win32® applications that use ADO.
The Component Gallery contains the ADO Data Bound Dialog Wizard, which guides you through the process of creating a Microsoft Foundation Class Library (MFC) data bound dialog box with ADO. The controls of the dialog box bind to the fields of a recordset. Using the wizard, you can automatically generate all of the resources, classes, and Component Object Model (COM) initialization code necessary to build a data bound dialog box and add it to your project.
For more information about using Visual C++ with ADO, see the MSDN Library at Microsoft Web site.