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

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

?? ch14.htm

?? 21天學會VC的英文版
?? 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一区二区三区免费野_久草精品视频
日本成人在线网站| 91同城在线观看| 色婷婷国产精品| 欧美va在线播放| 亚洲精品欧美激情| 紧缚捆绑精品一区二区| 欧美无砖专区一中文字| 久久九九影视网| 麻豆91免费观看| 欧美天堂一区二区三区| 国产精品成人免费精品自在线观看 | 香蕉乱码成人久久天堂爱免费| 国产成+人+日韩+欧美+亚洲| 欧美一区欧美二区| 亚洲女爱视频在线| 国产成人综合亚洲91猫咪| 777午夜精品免费视频| 一区二区日韩av| 成人动漫av在线| 亚洲欧美日韩久久| 91碰在线视频| 国产精品久久久久一区二区三区| 国产九色sp调教91| 欧美mv日韩mv国产网站app| 免播放器亚洲一区| 日韩精品中文字幕一区| 奇米色777欧美一区二区| 91精品国产综合久久精品麻豆 | 国产精品妹子av| 国产在线不卡一区| 久久久久久久久免费| 国产成a人亚洲精品| 亚洲国产精品二十页| 国产精品18久久久久久久久| 久久久www成人免费毛片麻豆 | 国产乱码精品一区二区三区忘忧草| 欧美一区二区在线不卡| 美女脱光内衣内裤视频久久影院| 欧美一三区三区四区免费在线看| 日本大胆欧美人术艺术动态| 精品久久久久久久久久久院品网| 韩国女主播成人在线| 国产清纯在线一区二区www| 丁香啪啪综合成人亚洲小说 | 免费在线一区观看| 精品久久国产老人久久综合| 国产馆精品极品| 亚洲人成人一区二区在线观看 | 91免费看片在线观看| 亚洲欧美日韩一区二区三区在线观看| 91黄色免费观看| 性做久久久久久久久| 欧美大胆一级视频| 激情图区综合网| 亚洲视频一二三| 欧美日韩国产电影| 国产一区二区三区在线观看精品| 欧美精彩视频一区二区三区| 日本丶国产丶欧美色综合| 国产在线视视频有精品| 国产精品久久看| 欧美电影在线免费观看| 久久99精品久久只有精品| 国产欧美1区2区3区| 欧美日韩你懂得| 国内精品视频一区二区三区八戒| 欧美极品xxx| 欧美日韩中文另类| 国产一区二区三区免费看| 亚洲日本免费电影| 日韩一区二区三免费高清| 成人av在线影院| 视频在线在亚洲| 国产精品乱码一区二三区小蝌蚪| 欧美精品丝袜久久久中文字幕| 国产二区国产一区在线观看| 亚洲国产精品一区二区www在线 | 亚洲第一会所有码转帖| 精品对白一区国产伦| 色婷婷av一区二区| 国产福利一区二区| 国产大陆亚洲精品国产| 久久久99精品免费观看| 欧美午夜精品理论片a级按摩| 黄页视频在线91| 亚洲午夜av在线| 蜜桃传媒麻豆第一区在线观看| 国产精品国产三级国产专播品爱网 | 亚洲国产精品成人综合| 欧美高清精品3d| 91小视频在线| 国产精品影视在线| 九九国产精品视频| 日日欢夜夜爽一区| 一卡二卡三卡日韩欧美| 中文字幕精品在线不卡| 日韩美女主播在线视频一区二区三区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 一区二区激情小说| 国产精品国产精品国产专区不片| 久久精品日韩一区二区三区| 日韩精品在线看片z| 欧美日韩精品一区二区三区蜜桃 | 大尺度一区二区| 国产在线观看一区二区| 麻豆精品在线观看| 久久精品久久精品| 日本一道高清亚洲日美韩| 亚洲一二三区不卡| 午夜久久久影院| 午夜亚洲国产au精品一区二区| 一区二区三区精品在线观看| 亚洲日本一区二区三区| 亚洲人成在线播放网站岛国| 成人免费在线观看入口| 自拍偷在线精品自拍偷无码专区| 欧美国产日韩一二三区| 国产精品免费视频一区| 中文字幕一区二区三区精华液| 国产精品美女一区二区| 一区精品在线播放| 亚洲最新视频在线观看| 亚洲最新视频在线播放| 天天综合网天天综合色| 蜜臀av在线播放一区二区三区| 美女一区二区三区| 国产成人av资源| 97精品电影院| 欧美色综合网站| 91精品婷婷国产综合久久竹菊| 日韩一级欧美一级| 久久久综合视频| 亚洲日本免费电影| 午夜精品久久久久影视| 久久99精品久久久久| 国产成人免费在线观看| 色婷婷激情久久| 日韩免费高清视频| 最新中文字幕一区二区三区| 亚洲天堂中文字幕| 视频一区在线视频| 国产一区二区三区久久悠悠色av| 不卡视频一二三四| 欧美日韩午夜在线| 久久久久久亚洲综合| 欧美日韩国产三级| 欧美成人r级一区二区三区| 欧美国产亚洲另类动漫| 亚洲线精品一区二区三区| 日本欧美在线看| 国产麻豆精品theporn| 久久蜜桃av一区精品变态类天堂 | 99精品国产99久久久久久白柏| 91久久久免费一区二区| 欧美高清视频一二三区 | 欧美高清一级片在线| 久久久久久久久久久电影| 国产精品无码永久免费888| 午夜精品视频一区| 成人激情校园春色| 欧美一区二区三区在线| 中文字幕亚洲欧美在线不卡| 日韩精品一二三区| 色婷婷国产精品| 国产嫩草影院久久久久| 日本vs亚洲vs韩国一区三区| av在线不卡免费看| 精品99一区二区| 无码av免费一区二区三区试看| 成人动漫视频在线| 精品日韩欧美在线| 日韩二区三区四区| 色偷偷一区二区三区| 国产午夜精品一区二区三区嫩草 | 久久精品免视看| 婷婷夜色潮精品综合在线| 99精品国产91久久久久久| 国产校园另类小说区| 蜜臀av性久久久久蜜臀av麻豆| 在线观看欧美日本| 中文字幕亚洲综合久久菠萝蜜| 国产一区在线视频| 日韩欧美国产系列| 美女mm1313爽爽久久久蜜臀| 欧美日韩免费电影| 亚洲一区二区不卡免费| av一二三不卡影片| 中日韩免费视频中文字幕| 国产精品乡下勾搭老头1| 精品免费视频.| 国产综合一区二区| 精品国产免费一区二区三区四区| 日本不卡视频在线观看| 欧美日韩精品一区二区在线播放| 亚洲午夜免费电影| 欧美日韩不卡一区| 日韩av一区二区在线影视| 在线综合视频播放| 久久成人麻豆午夜电影| 精品久久久久久久一区二区蜜臀|