Question 1: After inputting the listing from 9.8 into the ADOMFC1 project, ADOMFC1 will not compile, giving a "error C2027: use of undefined type 'DbComponent'", even though I added the #include directives for ATLTest1_i.c and ATLTest1.h as shown on page 178.
Solution 1: We have had no reports of there being any bugs, so it is probably in your code somewhere.
Try installing the source code off of the CD, and then compare your code with the ADOMFC1 code from the CD. Also compare your code to the ATLTest1 code from the CD. If anything is different between your code and the code off of the CD, that should enable you to find the problem.
In only 21 days, you'll have all the skills you need to get up and running efficiently. With this complete tutorial, you'll master the basics of database programming and then move on to the more advanced features and concepts. Understand the fundamentals of database programming in Visual C++. Master all the new and advanced database features that Visual C++6 offers. Learn how to effectively use the latest tools and features of Visual C++ for database programming by following practical, real-world examples. Get expert tips from a leading authority for programming your databases with Visual C++ 6 in the corporate environment.
Who Should Read This Book. What You Will Need to Use This Book.
WEEK 1. AT A GLANCE.
Day 1. Choosing the Right Database Technology.
Deciding the Appropriate Database Technology for Your Visual C++ Applications. Building Your Own Database in C++. Defining Metadata. A C++ Base Class to Handle the Database Work. Problems with Building Your Own Database. OLE Structured Storage. Record Managers (Btrieve). Desktop Databases (FoxPro and Access). Accessing ISAM Data over a LAN. Object Databases. Relational Database Servers (Oracle and SQL Server). How Do the Database Technologies Compare? Summary. Q&A. Workshop.
Day 2. Tools for Database Development in Visual C++ Developer Studio.
How to Build a Perfect Database Every Time. Support for the Relational Database Model in the Visual C++ Developer Studio. Installing the Database Components for Visual C++. Setting Up an ODBC Data Source for the Sample Database. Components of a Relational Database. Tables in a Relational Database. Fields in a Relational Database Table. Data Types in Relational Database Systems. Records in a Relational Database Table. Primary Keys in a Relational Database Table. Relationships between Records in Different Tables. Summary. Q&A. Workshop.
Day 3. Retrieving Data through Structured Query Language (SQL).
Structured Query Language. The SQL SELECT Statement. The ORDER BY Clause. The WHERE Clause. SQL Joins. SQL Subqueries. Resultsets and Cursors. Summary. Q&A. Workshop.
Day 4. Retrieving SQL Data through a C++ API.
Relational Database APIs. Microsoft Universal Data Access. ActiveX Data Objects (ADO). Techniques for Using ADO in C++ Applications. Building C++ Applications That Use ADO. Exception Handling for ADO. Displaying Records in a List Control. Summary. Q&A. Workshop.
Day 5. Adding, Modifying, and Deleting Data.
Cursor Types in ADO Recordsets. The ADO AddNew, Update, and Delete Functions. The AddNew Function. The Update Function. The Delete Function. The SQL INSERT, UPDATE, and DELETE Statements. The SQL INSERT Statement. The SQL UPDATE Statement. The SQL DELETE Statement. Summary. Q&A. Workshop.
Day 6. Harnessing the Power of Relational Database Servers.
Multitier Applications. How to Process Data at the Server. SQL Statements for Processing Data at the Server. The SQL INSERT Statement. The SQL UPDATE Statement. The SQL DELETE Statement. SQL Stored Procedures. C++ Tools for Processing Data at the Server. Calling Stored Procedures with ADO Command Objects. Calling Stored Procedures That Take Parameters. Summary. Q&A. Workshop.
Day 7. Database Design.
Database Normalization. Rules of Thumb for Relational Database Design. Normal Forms of the Relational Database Model. SQL Data Definition Language. Using Constraints and Indexes in a Relational Database. Tools and Techniques for Managing Relationships in a Relational Database. Using Constraints to Enforce Relationships. Summary. Q&A. Workshop.
WEEK 1. IN REVIEW.
WEEK 2. AT A GLANCE.
Day 8. Utilizing the Capabilities of Database Servers.
Database Transactions. SQL Transaction Statements. Triggers to Execute SQL Code Automatically. SQL Aggregate Functions. COUNT. MAX, MIN, SUM, and AVG. Aggregate Functions and the GROUP BY Clause. SQL Views. Summary. Q&A. Workshop.
Day 9. Understanding COM.
The Limitations of Traditional Windows DLLs. What Win32 DLLs are and how they Work. The Limits of Using Win32 DLLs for Building Software Components. Building Software Components by Using COM. Using C++ Abstract Base Classes. Creating Objects by Using an API Function. COM Clients and COM Servers. COM Servers. The Active Template Library (ATL). IUnknown, QueryInterface, AddRef, and Release. Interface Definition Language. Automation (Formerly Called OLE Automation). COM Type Libraries. Summary. Q&A. Workshop.
Day 10. Database Client Technologies and the Secrets of ADO.
An Overview of Database Client Technologies. ODBC. MFC ODBC Classes. DAO. RDO. OLE DB. ADO. Database Client Technology Summary. The Secrets of ADO. ADO's History. ADO and COM. Summary. Q&A. Workshop.
Day 11. Multitier Architectures.
Layered Architecture. The OSI Model. Layered Architecture for Multitier Applications. Database Data and the Internet. CGI--The Original Technique for Interfacing Databases with Web Servers. DLLs and Server Scripts--An Improved Technique for Interfacing Databases with Web Servers. The XML Files. What Color of Edsel would you Like? Using ActiveX Controls and RDS to Build Elegant Thin Clients. Summary. Q&A. Workshop.
Day 12. Using Microsoft Transaction Server to Build Scalable Applications.
The Infrastructure for Multitier Applications. Using MTS to Build Multitier Applications. Where to Find MTS and How to Install It. How MTS Works in Multitier Applications. Managing MTS Components by Using Packages. Creating an MTS Component, Using Visual C++ and the ATL. Using the OLE-COM Viewer to Instantiate Your Component. Using the Windows Scripting Host to Test Your Component. Testing Your Component in an Active Server Page. Installing Your Component in MTS. Calling Your MTS Component from an Active Server Page. Returning an ADO Recordset from MTS Component to an Active Server Page. Debugging MTS Components. Summary. Q&A. Workshop.
Day 13. Melding Object-Oriented Programming with Relational Databases.
Relational Databases and Object-Oriented Languages, the Oil and Vinegar of Modern Application Development. How the Relational Model and the Object Model Differ. Object Databases versus Relational Databases. The Costs and Benefits of Using Relational Databases with C++. Techniques for Integrating Relational Databases with Object-Oriented C++ Programs. Begin by Designing the Relational Database. Create Simple Object/Relational Mappings. Create a Live Object Cache. Use the Strengths of Both Models. Summary. Q&A. Workshop.
Day 14. Legacy Database APIS.
ODBC. The ODBC Driver Administrator. The ODBC Driver Manager. The ODBC Driver. Programmatic Sequence for the ODBC API. Step 1: Connect to a Data Source. Step 2: Allocate a Statement Handle. Step 3: Prepare and Execute the SQL Statements. Step 4: Get the Results. Step 5: Committing the Transaction. A Simple Example. MFC Wrappers for ODBC. CDatabase. CRecordSet. DAO. The Jet Database Engine. CdbDBEngine: The Root of It All. CdbDBWorkspace. CdbDBDatabase. CdbDBRecordsets. MFC Wrappers for DAO. CDaoWorkspace. CDaoDatabase. CDaoRecordSet. A Simple Example. Summary. Q&A. Workshop.
WEEK 2. IN REVIEW.
WEEK 3. AT A GLANCE.
Day 15. The ODBC API and the MFC ODBC Classes.
The Address Book. Using the MFC ODBC Wrapper Classes. Creating the Application. Getting Data. Updating the Application's Variables. Using the MFC DAO Wrapper Classes. Taking a Closer Look. Getting Data. Other DAO Classes. Summary. Q&A. Workshop.
Day 16. The Ultimate Database API: OLE DB.
An API for All Data Sources. The Components of an OLE DB Application. Making Data Sources Available. Comparing OLE DB to ODBC. The OLE DB Object Hierarchy. Enumerator. DataSource. Session. Command. Rowset. Index. Error. Transaction. Getting the Latest OLE DB Information. Summary. Q&A. Workshop.
Day 17. Accessing a Data Source with OLE DB.
Data Consumers and Providers. Interfaces. Interface Factoring. Interface Negotiations. OLE DB Application Flow. Enumerators. The IParseDisplayName Interface. The ISourcesRowset Interface. The IDBInitialize Interface. The IDBProperties Interface. The ISupportErrorInfo Interface. Using an Enumerator: A Simple Example. The DataSource Object. The IDBCreateSession Interface. The IDBDataSourceAdmin Interface. The IDBInfo Interface. The IPersist Interface. The IPersistFile Interface. Connecting to a DataSource Object. The OLE DB ODBC Provider. Example: Connecting to an OLE DB ODBC Data Source. Summary. Q&A. Workshop.
Day 18. Querying a Data Source with OLE DB.
Sessions. The IGetDataSource Interface. The IOpenRowset Interface. The ISessionProperties Interface. The IDBCreateCommand Interface. The IDBSchemaRowset Interface. The ITableDefinition Interface. The IIndexDefinition Interface. The ITransaction, ITransactionJoin, ITransactionLocal, and ITransaction Object Interfaces. Commands. The IAccessor Interface. The IColumnsInfo Interface. The ICommand Interface. The ICommandProperties Interface. The ICommandText Interface. The IConvertType Interface. The IColumnsRowset Interface. The ICommandPrepare Interface. The ICommandWithParameters Interface. A SQL Compendium. SQL Queries--Data Manipulation Language. SELECT. Clauses. INSERT INTO. UPDATE. DELETE. SQL--Data Definition Language. CREATE. ALTER. DROP. Creating and Executing Commands. Creating and Executing a Command. Accessors. Elements of a Parameter Accessor. Command Parameters. Multiple Resultsets. Summary. Q&A. Workshop.
Day 19. Navigating the Result of a Query.
Rowset Interfaces. The IRowset Interface. The IRowsetInfo Interface. The IConnectionPointContainer Interface. The IRowsetChange Interface. The IRowsetIdentity Interface. The IRowsetLocate Interface. The IRowsetResynch Interface. The IRowsetScroll Interface. The IRowsetUpdate Interface. The Six-Step Plan to Retrieving Data. Creating Bindings. Row Set Accessors. Retrieving Rows and Columns. Navigation. Bookmarks. Deferred Access. Column Types. BLOBs. Unicode String Processing. Cursors. Static Cursors. KeySet Cursors. Dynamic Cursors. Summary. Q&A. Workshop.
Day 20. Properties, Transactions, and Indexes.
Properties and Groups. Getting Properties. Setting Properties. A Review of OLE DB Object Properties. Transactions. The ITransaction Interface. The ITransactionLocal Interface. The ITransactionOptions Interface. The ITransactionObject Interface. The ITransactionJoin Interface. Creating Transactions. Committing and Aborting Transactions. Nesting Transactions. Isolation Levels and Locking. The Index Object. The IRowsetIndex Interface. Using the Index Object. Summary. Q&A. Workshop.
Day 21. OLE DB Error Handling.
Basic Error Handling. Checking Error Results. Automation Error Objects. The ISupportErrorInfo Interface. The IErrorInfo Interface. OLE DB Error Objects. The IErrorRecords Interface. The IErrorLookup Interface. The ISQLErrorInfo Interface. The Completed DispErrorInfo Source Code. How to Integrate the DispErrorInfo Procedure. Error-Handling Considerations. Returning Error Objects. Threads. A Summary of OLE DB HRESULT Error Codes. Summary. Q&A. Workshop.
WEEK 3. IN REVIEW.
Appendix A. What's on the CD?
Appendix B. Additional Resources.
Appendix C. Installing the Microsoft Data Access Components.
Appendix D. Interpreting Results.
Appendix E. Using ADO via the OLE DB SDK.
Appendix F. Answers.