⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcg04.htm

📁 Visual C++与数据库的连接经典实例
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML>

<HEAD>

<TITLE>vcg04.htm </TITLE>

<LINK REL="ToC" HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/index.htm">

<LINK REL="Index" HREF="htindex.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/htindex.htm">

<LINK REL="Next" HREF="vcg05.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcg05.htm">

<LINK REL="Previous" HREF="vcgp2.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcgp2.htm"></HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

<A NAME="I0"></A><P ALIGN=CENTER>

<A HREF="vcgp2.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcgp2.htm" TARGET="_self"><IMG SRC="blanprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/blanprev.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/index.htm" TARGET="_self"><IMG SRC="blantoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/blantoc.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="TOC"></A>

<A HREF="vcg05.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcg05.htm" TARGET="_self"><IMG SRC="blannext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/blannext.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Next Page"></A>


<HR ALIGN=CENTER>

<P>

<UL>

<UL>

<UL>

<LI>

<A HREF="#E68E28" >Classifying Database Systems</A>

<UL>

<LI>

<A HREF="#E69E105" >Database Terminology</A>

<LI>

<A HREF="#E69E106" >Flat-File Databases</A>

<LI>

<A HREF="#E69E107" >The Network and Hierarchical Database Models</A>

<LI>

<A HREF="#E69E108" >The Relational Database Model</A>

<LI>

<A HREF="#E69E109" >Types of Relational Database Managers</A>

<UL>

<LI>

<A HREF="#E70E23" >Relational SQL Database Management Systems</A>

<LI>

<A HREF="#E70E24" >Three-Tier Client-Server Architecture and LOBjects</A>

<LI>

<A HREF="#E70E25" >Traditional Desktop Relational Database Managers</A>

<LI>

<A HREF="#E70E26" >Microsoft Access: A Hybrid RDBMS</A></UL></UL>

<LI>

<A HREF="#E68E29" >Modeling Data</A>

<UL>

<LI>

<A HREF="#E69E110" >Database Diagrams</A>

<LI>

<A HREF="#E69E111" >Using Modeling Tools for Database Design</A></UL>

<LI>

<A HREF="#E68E30" >Rules for Relational Database Design</A>

<UL>

<LI>

<A HREF="#E69E112" >Organizing Entity Classes</A>

<LI>

<A HREF="#E69E113" >Normalizing Table Data</A>

<UL>

<LI>

<A HREF="#E70E27" >First Normal Form</A>

<LI>

<A HREF="#E70E28" >Second Normal Form</A>

<LI>

<A HREF="#E70E29" >Third Normal Form</A>

<LI>

<A HREF="#E70E30" >Over-Normalizing Data and Performance Considerations</A>

<LI>

<A HREF="#E70E31" >Fourth Normal Form</A>

<LI>

<A HREF="#E70E32" >Fifth Normal Form</A></UL></UL>

<LI>

<A HREF="#E68E31" >Indexing Tables for Performance and Domain Integrity</A>

<UL>

<LI>

<A HREF="#E69E114" >Table Indexing Methods</A>

<UL>

<LI>

<A HREF="#E70E33" >Records and Data Pages</A>

<LI>

<A HREF="#E70E34" >Balanced-Tree Indexes</A></UL>

<LI>

<A HREF="#E69E115" >Choosing Fields to Index</A></UL>

<LI>

<A HREF="#E68E32" >Summary</A></UL></UL></UL>

<HR ALIGN=CENTER>

<A NAME="E66E13"></A>

<H1 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>- 4 -</B>

<BR><B>Optimizing the Design of Relational Databases</B></FONT></CENTER></H1>

<BR>

<P>This chapter describes the theoretical and practical sides of relational database management systems (RDBMSs), including how to design a relational database system or a set of relational tables to achieve optimum performance with Visual C++ 4.0 database applications. This book distinguishes between a client-server RDBMS such as Microsoft SQL Server 6.0, a desktop RDBMS such as Access 2.0/95, and a set of relational tables such as a database created from a collection of dBASE table and index files. This chapter also covers indexing methods that improve the speed of searching for a specific record in a table and increase the performance when two or more related tables are joined.

<BR>

<P>This book is aimed at Visual C++ programmers who want to extend their programming skills to 32-bit Windows database applications and at database developers who are making the transition from the character-based world of DOS to Windows' graphical environment.

<BR>

<P>Visual C++ 4.0 is an ideal tool for use with client-server RDBMSs (also called SQL databases), so a substantial part of this book is devoted to creating front ends for displaying and updating data in networked client-server environments. This chapter is intended for readers with limited database design experience. If you're an accomplished relational database developer, you might want to skip this chapter for now and proceed to Chapter 5, &quot;Learning Structured Query Language.&quot;

<BR>

<BR>

<A NAME="E68E28"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Classifying Database Systems</B></FONT></CENTER></H3>

<BR>

<P>The history of digital computers is inexorably tied to the concurrent development of database methodology. It's probably a safe estimate that at least 80 percent of worldwide computer resources and programming activity are devoted to database applications.

<BR>

<P>The first military and commercial applications for tabulating machines and digital computers were devoted to retrieving, calculating, and reporting on data stored in the form of punched cards. For example, a deck of cards containing the names and addresses of customers constituted a database table. Another deck of punched cards, containing information on the invoices issued to customers for a given period, represented another table. Using a collating device, you could shuffle the two decks so that a new deck was created wherein each customer card was followed by the cards detailing the orders for that customer. You could then use the cards to print a report in which the customer's card provided a report subheading and all of the orders for that customer were printed under the subheading. Cards from other decks could be collated into the two-level deck to create more detailed reports. Early tabulating machines could create customer subtotals and order grand totals. Figure 4.1 shows the effect of collating two decks of cards to print a report of invoices.

<BR>

<P><B><A HREF="04vcg01.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/04vcg01.gif">Figure 4.1. Collating punched cards for customers and invoices in order to print a report.</A></B>

<BR>

<P>The obvious problem with the punched-card collation technique was that every time you wanted a different report, you had to separate (decollate) the cards back into their original decks, then manually run a different set of collation processes. Replacing tabulating machines with computers equipped with nine-track magnetic tape drives solved many of the problems associated with moving decks of cards back and forth between collators. You transferred the data from a sorted deck of cards to a magnetic tape and then mounted the tapes you needed on tape drives and let the computer combine (merge) the data from the &quot;table&quot; tapes onto a new tape whose data was identical to that of a collated deck of punched cards. Now you could print a report from the data on the newly recorded tape.

<BR>

<P>Punched-card decks and magnetic tapes are sequential devices. Finding a particular record requires that you begin searching from the first card of the deck or the first record of a tape and read each card or record until you find a match (or determine that no matching record exists). When high-capacity random-access data storage devices (such as disk drives) became available, searching for a particular record became much faster, even if you had to read each record in the table. To speed the process, sorting and indexing methods were developed to minimize the number of records that the computer had to read until it found the matching data. The seminal work in this field was Volume 3 of Stanford University Professor Donald E. Knuth's <I>Art of Computer Programming</I> series, <I>Sorting and Searching,</I> (Addison-Wesley, 1973). It's still in print today.

<BR>

<P>Advances in computer technology after the advent of the random-access disk drive have occurred primarily in the form of architectural, rather than conceptual, changes to both hardware and software. The pace of improvement in the operating speed and the rate of cost reduction of computer hardware has far out-distanced the rate of progress in software engineering, especially in database design and programming methodology. You can substantially improve the performance of an ill-conceived and poorly implemented database design simply by acquiring a faster computer. The price of a new computer is usually much less than the cost of re-engineering the organization's legacy database structure. Ultimately, however, poor database designs and implementations result in a severe case of organizational inefficiency. One of the purposes of this chapter is to provide a sufficient background in database design to make sure that the database structures you create don't fall into this category.

<BR>

<P>The following sections discuss elementary database terminology in the object-oriented language to which you were introduced in Chapter 2, &quot;Understanding MFC's ODBC Database Classes.&quot; Then you will learn about the different types of computer database structures used today.

<BR>

<BR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -