亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch14.htm

?? /// //Visual C++ 6.0 21天自學教程
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"><SCRIPT LANGUAGE="JavaScript"><!--function popUp(pPage) { var fullURL = document.location; var textURL = fullURL.toString(); var URLlen = textURL.length; var lenMinusPage = textURL.lastIndexOf("/"); lenMinusPage += 1; var fullPath = textURL.substring(0,lenMinusPage); popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394'); figDoc= popUpWin.document; zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>'; zhtm += '</head>'; zhtm += '<BODY bgcolor="#FFFFFF">'; zhtm += '<IMG SRC="' + fullPath + pPage + '">'; zhtm += '<P><B>' + pPage + '</B>'; zhtm += '</BODY></HTML>'; window.popUpWin.document.write(zhtm); window.popUpWin.document.close(); // Johnny Jackson 4/28/98 }//-->                                                                </SCRIPT><link rel="stylesheet" href="/includes/stylesheets/ebooks.css">	<META NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1.1">	<TITLE>Teach Yourself Visual C++ 6 in 21 Days -- Ch 14 -- Retrieving Data from an ODBC Database8</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><H1 ALIGN="CENTER"><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM"BORDER="0"><BR>Teach Yourself Visual C++ 6 in 21 Days</H1><CENTER><P><A HREF="../ch13/ch13.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch15/ch15.htm"><IMGSRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <HR></CENTER><H1 ALIGN="CENTER">- 14 -<BR>Retrieving Data from an ODBC Database</H1><H1></H1><UL>	<LI><A HREF="#Heading1">Database Access and ODBC</A>	<UL>		<LI><A HREF="#Heading2">The Open Database Connector (ODBC) Interface</A>		<LI><A HREF="#Heading3">The CRecordset Class</A>	</UL>	<LI><A HREF="#Heading4">Creating a Database Application Using ODBC</A>	<UL>		<LI><A HREF="#Heading5">Preparing the Database</A>		<LI><A HREF="#Heading6">Creating the Application Shell</A>		<LI><A HREF="#Heading7">Designing the Main Form</A>		<LI><A HREF="#Heading8">Adding New Records</A>		<LI><A HREF="#Heading9">Deleting Records</A>	</UL>	<LI><A HREF="#Heading10">Summary</A>	<LI><A HREF="#Heading11">Q&amp;A</A>	<LI><A HREF="#Heading12">Workshop</A>	<UL>		<LI><A HREF="#Heading13">Quiz</A>		<LI><A HREF="#Heading14">Exercise</A>	</UL>	<LI><A HREF="#Heading15">In Review</A></UL><P><HR SIZE="4"><BR>A large number of applications use a database. Everything from a personal organizerto a large, corporate personnel system uses a database to store and maintain allthe records that the applications use and manipulate. Visual C++ provides you withfour different technologies for using and accessing databases in your applications,Data Access Objects (DAO), ODBC, OLE DB, and ActiveX Data Objects (ADO). Today andtomorrow, you'll learn about two of these technologies, how they differ, and howyou can use them in your own applications. Today, you will learn</P><P><UL>	<LI>How the ODBC interface allows you to use a consistent way to access a database.	<P>	<LI>How Visual C++ uses the CRecordset class to provide access to an ODBC data source.	<P>	<LI>How you can create a simple database application using the Wizards in Visual	C++.	<P>	<LI>How you can add and delete records from an ODBC database in Visual C++.</UL><H2><A NAME="Heading1"></A>Database Access and ODBC</H2><P>Most business applications work with data. They maintain, manipulate, and accessrecords of data that are stored in databases. If you build business applications,odds are that you will need to be able to access a database with your applications.The question is, which database?</P><P>There are a number of databases on the market. If you need to create a single-userapplication that is self-contained on a single computer, you can use any one of numerousPC-based databases, such as Microsoft's Access, FoxPro, or Borland's Paradox. Ifyou are building applications that need to access large, shared databases, you areprobably using an SQL-based (Structured Query Language) database such as SQL Serveror Oracle. All of these databases provide the same basic functionality, maintainingrecords of data. Each will allow you to retrieve several records or a single record,depending on your needs. They'll all let you add, update, or delete records as needed.Any of these data- bases will be able to serve your application's needs, so you shouldbe able to use any database for one application and then switch to another for thenext application, based on the needs of the application and which database is mostsuited for the specific application needs (or your employer's whim).</P><BLOCKQUOTE>	<P><HR><STRONG>NOTE:</STRONG> To be completely honest, there are numerous differences between the	various databases that are available today. Each of these databases has specific	strengths and weaknesses, making one more suitable for a specific situation than	another. However, a discussion of the differences between any of these databases	is beyond the scope of this book. For the discussions of databases today and tomorrow,	you can assume that all of these databases are functionally equal and interchangeable.<HR></BLOCKQUOTE><P>The problem that you will encounter when you switch from one database to anotheris that each database requires you to use a different interface for accessing thedatabase. Therefore, you have to learn and use a whole new set of programming techniquesand functions for each database that you need to work with. This is the problem thatthe ODBC interface was designed to correct.</P><P><H3><A NAME="Heading2"></A>The Open Database Connector (ODBC) Interface</H3><P>Microsoft saw the incompatibility between database interfaces as a problem. Eachdatabase had its own application development language that was well integrated withthe database but didn't work with any other database. This presented a problem toany developer who needed to use one database for an application and then a differentdatabase for the next application. The developer had to learn the specific developmentlanguage for each of the databases and couldn't use any languages that she alreadyknew. For programmers to work with any database with the programming language ofthe developer's choice, they needed a standardized interface that works with everydatabase.</P><P>The Open Database Connector (ODBC) interface is implemented as a standard, SQL-basedinterface that is an integral part of the Windows operating system. Behind this interfaceare plug-ins for each database that take the ODBC function calls and convert theminto calls to the specific interface for that database. The ODBC interface also usesa central set of database connection configurations, with a standardized way of specifyingand maintaining them. This setup allows programmers to learn and use a single databaseinterface for all databases. This also allowed programming language vendors to addODBC support into their languages and development tools to make database access allbut transparent.</P><P><H3><A NAME="Heading3"></A>The CRecordset Class</H3><P>In the Visual C++ development environment, most of the ODBC functionality hasbeen encapsulated into two classes, CRecordset and CDatabase. The CDatabase classcontains the database connection information and can be shared across an entire application.The CRecordset class encapsulates a set of records from the database. The CRecordsetclass allows you to specify a SQL query to be run, and the CRecordset class willrun the query and maintain the set of records that are returned by the database.You can modify and update the records in the record set, and your changes will bepassed back to the database. You can add or delete records from the record set, andthose same actions can be passed back to the database.</P><P><H4>Connecting to the Database</H4><P>Before the CRecordset class can perform any other functions, it has to be connectedto a database. This is accomplished through the use of the CDatabase class. You don'tneed to create or set the CDatabase instance; the first instance of the CRecordsetclass does this for you. When you create an application using the AppWizard and chooseto include ODBC database support, the AppWizard includes the database connectioninformation in the first CRecordset-derived class that it creates. When this CRecordsetclass is created without being passed a CDatabase object, it uses the default connectioninformation, which was added by the AppWizard, to create its own database connection.</P><P><H4>Opening and Closing the Record Set</H4><P>Once the CRecordset object is created and connected to the database, you needto open the record set to retrieve the set of records from the database. Do thisby calling the Open member function of the CRecordset object. You can call this functionwithout any arguments if you want to take the default values for everything, includingthe SQL statement to be executed.</P><P>The first argument to the Open function is the record set type. The default valuefor this, AFX_DB_USE_DEFAULT_TYPE, is to open the record set as a snapshot set ofrecords. Table 14.1 lists the four types of record set types. Only two of these recordset types are available in the AppWizard when you are specifying the data source.</P><P><H4>TABLE 14.1. RECORD SET TYPES.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Type</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::dynaset		</TD>		<TD ALIGN="LEFT">A set of records that can be refreshed by calling the Fetch function so that changes			made to the record set by other users can be seen.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::snapshot		</TD>		<TD ALIGN="LEFT">A set of records that cannot be refreshed without closing and then reopening the			record set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::dynamic		</TD>		<TD ALIGN="LEFT">Very similar to the CRecordset::dynaset type, but it is not available in many ODBC			drivers.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::forwardOnly		</TD>		<TD ALIGN="LEFT">A read-only set of records that can only be scrolled from the first to the last record.		</TD>	</TR></TABLE></P><P>The second argument to the Open function is the SQL statement that is to be executedto populate the record set. If a NULL is passed for this argument, the default SQLstatement that was created by the AppWizard is executed.</P><P>The third argument is a set of flags that you can use to specify how the set ofrecords is to be retrieved into the record set. Most of these flags require an in-depthunderstanding of the ODBC interface so you understand how the flags can and shouldbe used in your applications. Because of this, I'll discuss only a few of these flagsin Table 14.2.</P><P><H4>TABLE 14.2. RECORD SET OPEN FLAGS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Flag</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::none		</TD>		<TD ALIGN="LEFT">The default value for this argument; specifies that no options affect how the record			set is opened and used.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::appendOnly		</TD>		<TD ALIGN="LEFT">This flag prevents the user from being able to edit or delete any of the existing			records in the record set. The user will only be able to add new records to the set			of records. You cannot use this option with the CRecordset::readOnly flag.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRecordset::readOnly		</TD>		<TD ALIGN="LEFT">This flag specifies that the record set is read-only and no changes can be made by			the user. You cannot use this option with the CRecordset::appendOnly flag.		</TD>	</TR></TABLE></P><P>Once the user finishes working with the record set, you can call the Close functionto close the record set and free any resources used by the record set. The Closefunction doesn't take any arguments.</P><P><H4>Navigating the Record Set</H4><P>Once you have a set of records retrieved from the database, you need to be ableto navigate the set of records (unless the set has only one record). The CRecordsetclass provides several functions for navigating the record set, allowing you to movethe user to any record. Table 14.3 lists the functions that you use to navigate therecord set.</P><P><H4>TABLE 14.3. RECORD SET NAVIGATION FUNCTIONS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Function</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">MoveFirst		</TD>		<TD ALIGN="LEFT">Moves to the first record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">MoveLast		</TD>		<TD ALIGN="LEFT">Moves to the last record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">MoveNext		</TD>		<TD ALIGN="LEFT">Moves to the next record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">MovePrev		</TD>		<TD ALIGN="LEFT">Moves to the previous record in the set.		</TD>	</TR>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区免费观看| 欧美在线高清视频| 亚洲一区二区不卡免费| 日韩精品一区二区三区中文精品 | 久久丁香综合五月国产三级网站| 国产欧美精品一区aⅴ影院| 欧美日韩国产一级| 不卡的看片网站| 蜜桃精品视频在线观看| 亚洲日本一区二区| 国产日韩精品一区二区三区在线| 欧美色爱综合网| aaa欧美大片| 国产一区二区三区精品视频| 日本特黄久久久高潮| 亚洲免费观看高清完整| 国产色综合一区| 日韩欧美国产电影| 欧美午夜一区二区| 97久久精品人人做人人爽| 国产成人综合网| 精品中文字幕一区二区| 日韩激情一二三区| 亚洲午夜av在线| 一区二区不卡在线视频 午夜欧美不卡在| 国产日产欧美一区二区三区| 精品国产自在久精品国产| 在线综合视频播放| 欧美三区免费完整视频在线观看| 色先锋aa成人| 97超碰欧美中文字幕| www.欧美精品一二区| 成人免费的视频| 国产精品一区2区| 国产伦精品一区二区三区在线观看 | 美女视频黄久久| 亚洲一区电影777| 夜夜夜精品看看| 亚洲一区二区视频| 亚洲亚洲精品在线观看| 亚洲影院免费观看| 亚洲综合久久av| 亚洲第一狼人社区| 婷婷久久综合九色国产成人| 奇米一区二区三区| 国产福利一区在线| 国产激情偷乱视频一区二区三区| 日本人妖一区二区| 久久精品99国产精品| 麻豆精品精品国产自在97香蕉| 久久国产精品99久久人人澡| 美女免费视频一区二区| 久久9热精品视频| 国产乱妇无码大片在线观看| 成人性视频免费网站| 成人av在线资源网| 色呦呦国产精品| 欧美日韩一本到| 欧美成人aa大片| 国产视频视频一区| 亚洲精品视频免费看| 亚洲午夜精品网| 精品一区二区av| 成人a免费在线看| 欧美色精品在线视频| 日韩一区二区三区免费观看| 久久众筹精品私拍模特| 国产精品女主播av| 性久久久久久久| 国产在线不卡一区| 色综合久久天天综合网| 欧美一区二区在线免费观看| wwwwxxxxx欧美| 亚洲视频在线一区| 日本女优在线视频一区二区| 粉嫩高潮美女一区二区三区| 91精品1区2区| 久久综合久久综合久久| ...xxx性欧美| 极品瑜伽女神91| 99国产一区二区三精品乱码| 51久久夜色精品国产麻豆| 国产欧美一区二区精品忘忧草 | 欧美日韩www| 亚洲国产高清aⅴ视频| 亚洲主播在线播放| 国产成人无遮挡在线视频| 欧美日韩精品一区二区天天拍小说 | 成人黄色777网| 欧美亚洲日本一区| 欧美国产精品中文字幕| 亚洲国产一区视频| 国模一区二区三区白浆| 色婷婷综合五月| 久久先锋影音av鲁色资源| 亚洲综合图片区| 国产成人在线视频网站| 欧美人xxxx| 亚洲欧洲美洲综合色网| 美女被吸乳得到大胸91| 色婷婷久久久综合中文字幕| 久久久欧美精品sm网站| 亚洲地区一二三色| 不卡在线观看av| 精品国产一区二区三区久久影院| 亚洲精品国产一区二区精华液| 精品一区二区在线视频| 欧美日韩在线直播| 自拍av一区二区三区| 国产精品一二二区| 日韩欧美国产三级| 婷婷中文字幕一区三区| 一本大道av伊人久久综合| 国产三级精品三级在线专区| 老司机免费视频一区二区 | 99精品热视频| 欧美经典三级视频一区二区三区| 日韩av在线播放中文字幕| 一本大道久久a久久综合婷婷 | 亚洲图片另类小说| 粉嫩久久99精品久久久久久夜 | 国产三级欧美三级日产三级99| 天天综合色天天综合色h| 在线观看亚洲一区| 一区二区三区小说| 97久久精品人人做人人爽| 中文字幕不卡在线| 国产白丝精品91爽爽久久| 久久免费偷拍视频| 国产精品自拍网站| 欧美精品一区二区三区在线播放| 日本欧美肥老太交大片| 久久中文字幕电影| 国精产品一区一区三区mba视频| 日韩精品在线看片z| 日韩黄色片在线观看| 337p亚洲精品色噜噜噜| 日韩国产在线观看| 精品日韩成人av| 黄色成人免费在线| 国产日韩亚洲欧美综合| 成人午夜在线视频| 亚洲视频狠狠干| 色婷婷久久久亚洲一区二区三区 | 亚洲人妖av一区二区| 一本一本久久a久久精品综合麻豆| 18成人在线视频| 色噜噜夜夜夜综合网| 亚洲一区二区三区中文字幕在线| 欧美三级在线看| 日韩专区中文字幕一区二区| 日韩欧美在线网站| 国内精品免费**视频| 国产精品无圣光一区二区| 91日韩一区二区三区| 亚洲va欧美va人人爽午夜| 日韩一区二区在线播放| 久久不见久久见免费视频1| 久久久美女毛片| 99久久国产综合精品女不卡| 亚洲综合一区二区精品导航| 69堂国产成人免费视频| 韩国av一区二区| 国产精品卡一卡二| 欧美日韩色一区| 久久国产人妖系列| 国产精品网站在线观看| 欧美视频你懂的| 蜜桃视频一区二区三区在线观看| 精品国产一区二区三区四区四| 成人精品电影在线观看| 亚洲一区二区三区中文字幕| 日韩欧美激情一区| av电影一区二区| 日韩主播视频在线| 中文字幕免费不卡| 欧美日韩在线亚洲一区蜜芽| 国产乱码一区二区三区| 亚洲伦在线观看| 日韩欧美国产一区二区在线播放| 成人av资源网站| 日本欧美韩国一区三区| 中文字幕不卡的av| 欧美一区二区视频在线观看2022| 成人福利视频在线| 日韩制服丝袜先锋影音| 国产精品嫩草影院av蜜臀| 欧美美女网站色| 成人avav影音| 麻豆精品视频在线观看视频| 亚洲精品乱码久久久久久| 久久久久久99久久久精品网站| 91黄视频在线| 国产精品18久久久久| 视频在线在亚洲| 综合av第一页| 国产日韩欧美制服另类| 日韩一级片网址| 91国产免费看| gogo大胆日本视频一区|