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

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

?? ch15.htm

?? 21天學會VC的英文版
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!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 15 -- Updating and Adding Database Records Through ADO</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="../ch14/ch14.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch16/ch16.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">- 15 -<BR>Updating and Adding Database Records Through ADO</H1><H1></H1><UL>	<LI><A HREF="#Heading1">What Is ADO?</A>	<UL>		<LI><A HREF="#Heading2">ADO Objects</A>		<LI><A HREF="#Heading3">Using the ADO ActiveX Control</A>		<LI><A HREF="#Heading4">Importing the ADO DLL</A>		<LI><A HREF="#Heading5">Connecting to a Database</A>		<LI><A HREF="#Heading6">Executing Commands and Retrieving Data</A>		<LI><A HREF="#Heading7">_CommandPtr pCmd;</A>		<LI><A HREF="#Heading8">Navigating the Recordset</A>		<LI><A HREF="#Heading9">Accessing Field Values</A>		<LI><A HREF="#Heading10">Updating Records</A>		<LI><A HREF="#Heading11">Adding and Deleting</A>		<LI><A HREF="#Heading12">Closing the Recordset and Connection Objects</A>	</UL>	<LI><A HREF="#Heading13">Building a Database Application Using ADO</A>	<UL>		<LI><A HREF="#Heading14">Creating the Application Shell</A>		<LI><A HREF="#Heading15">Building a Custom Record Class</A>		<LI><A HREF="#Heading16">3:</A>		<LI><A HREF="#Heading17">Connecting and Retrieving Data</A>		<LI><A HREF="#Heading18">Populating the Form</A>		<LI><A HREF="#Heading19">Saving Updates</A>		<LI><A HREF="#Heading20">Navigating the Record Set</A>		<LI><A HREF="#Heading21">Adding New Records</A>		<LI><A HREF="#Heading22">Deleting Records</A>	</UL>	<LI><A HREF="#Heading23">Summary</A>	<LI><A HREF="#Heading24">Q&amp;A</A>	<LI><A HREF="#Heading25">Workshop</A>	<UL>		<LI><A HREF="#Heading26">Quiz</A>		<LI><A HREF="#Heading27">Exercise</A>	</UL></UL><P><HR SIZE="4"><BR>Now that you've gotten your feet wet with an ODBC database application, one of theoldest Microsoft database access technologies, it's time to turn your attention tothe newest Microsoft database access technology, ActiveX Data Objects (ADO). Designedfor use with all of Microsoft's programming and scripting technologies, ADO presentsthe Visual C++ programmer with new challenges in database programming, while stillkeeping the functionality familiar. Today, you will learn</P><P><UL>	<LI>How ADO works and how it uses the OLE DB technology for providing simple database	access.	<P>	<LI>How you can build a simple ADO application in a couple of minutes using ActiveX	controls.	<P>	<LI>How you can build a complete database application using regular forms controls.	<P>	<LI>How you can use special ADO macros to build a custom record set class for use	in your database applications.</UL><BLOCKQUOTE>	<P><HR><STRONG>CAUTION:</STRONG> This chapter works with some features that may not be included	in all versions of Visual C++. Although ADO is an important new area of pro-gramming	with Microsoft data access technologies, this chapter discusses some things that	you may not have the ability to do with your version of Visual C++.<HR></BLOCKQUOTE><H2><A NAME="Heading1"></A>What Is ADO?</H2><P>A couple years ago, Microsoft designed a new data access technology called OLEDB. This data access technology was intended to be much more than simply a way ofgetting data into and out of databases. This technology was intended to be the meansof accessing data, regardless of where that data may be located. Through the OLEDB technology, you could access mail messages, spreadsheets, files, and so on. Anythingthat might have data could possibly be accessed through the OLE DB technology. Thiswas one of the first technologies to be produced from the research and developmentof the object- oriented file system at the heart of what Microsoft has been calling&quot;Cairo&quot; for the past few years.</P><BLOCKQUOTE>	<P><HR><STRONG>NOTE:</STRONG> Many of the technologies bundled under the product name of Cairo	will be released some time next year in the Windows NT 5.0 operating system.<HR></BLOCKQUOTE><P>As you can imagine, with the range of functionality that OLE DB must have to accessdata in all of those different sources, it might be quite complex to work with thistechnology. Well, it is. This is where ActiveX Data Objects come into play. ADO wasdesigned as another layer on top of OLE DB, specifically for providing database access.</P><P>One of the goals in designing ADO was to create a control that could be used toprovide data access and control in Web pages, caching the data records on the client.Part of the reason for this goal was to allow a Web browser user to access an entireset of data records, without having to pull down each individual record, one at atime, to navigate and make changes to the records. Because of this capability withADO, the ADO control is distributed with Microsoft's Internet Explorer Web browser(version 4.0 and above).</P><P><H3><A NAME="Heading2"></A>ADO Objects</H3><P>To make ADO as easily usable in scripting languages such as VBScript as it isin programming environments such as Visual Basic, Microsoft tried to keep the numberof objects to a minimum. As a result, you have a small number of basic objects:</P><P><UL>	<LI>Connection	<P>	<LI>Error	<P>	<LI>Command	<P>	<LI>Parameter	<P>	<LI>Recordset	<P>	<LI>Field</UL><P>Along with these objects, you have collection objects for containing collectionsof Error, Parameter, and Field objects.</P><P><H4>The Connection Object</H4><P>The Connection object is used for establishing and maintaining a connection toa database. This object is configured with the connection information, includingdatabase location, user ID, and password, before opening the connection. Once allof this information is appropriately configured, the connection object should haveits Open method called to open the connection. Once the Connection object goes outof scope, the connection is automatically closed. If you want more control over closingand opening the database connection, you can call the Connection object's Close methodto close the connection.</P><P>The Connection object is also the object through which any high-level connectionfunctionality is controlled. This includes all transaction control, through the Connectionobject's BeginTrans, CommitTrans, and RollbackTrans methods.</P><P><H4>The Error Object</H4><P>Whenever a database error occurs, the error information from the database is placedinto an ADO Error object. The error information in the error object is the databaseerror information, not ADO error information. Whenever you encounter an error andneed to look up the error information to determine what went wrong, you'll need toexamine the database error codes and descriptions, not the ADO error codes.</P><P><H4>The Command Object</H4><P>The Command object is used to execute commands in the database. You can use thisobject to run SQL statements or call stored procedures (SQL functions that are storedin the database). Any time that a command returns rows of data, you need to attachthe Command object to a Recordset object for the returned data to be stored in.</P><P>When you call a stored procedure, as with functions in any other programming language,you'll often need to pass parameters to the stored procedure. To pass these parameters,you'll attach a series of Parameter objects to the Command object. Each of the Parameterobjects will have the name of the parameter that it holds the value for, along withthe value that should be passed to the database for that particular parameter.</P><P><H4>The Parameter Object</H4><P>The Parameter object is used for passing variables and for calling stored proceduresor parameterized queries. These are attached to a Command object for use in callingthe command that has been programmed into the Command object.</P><P><H4>The Recordset Object</H4><P>The Recordset object contains a set of records from the database. The set of recordsis the result of a command being sent to the database that results in a set of recordsbeing returned. You can navigate through the Recordset, much like you do with theRecordset objects for other database access technologies. You can also access thefields in each record in the Recordset through the Field objects that are associatedwith the Recordset. You can update the records in the Recordset, and then use theRecordset to update the database. You can also insert new records into the Recordset,or delete records and have those changes made in the database.</P><P><H4>The Field Object</H4><P>The Field object represents a single column in the Recordset. Each Field objectcontains the column name, data value, and how the data value should be represented.Because ADO was designed to be used in Microsoft's scripting languages, and the onlydata type available in these scripting languages is the Variant data type, the Fieldobjects always contain a Variant data value. The data value is automatically convertedto the correct data type when updating to the database. As the programmer workingwith the ADO objects, you will have to convert the value from a Variant to whateverdata type you need it to be, as well as convert it back to a Variant when updatingthe value.</P><P><H3><A NAME="Heading3"></A>Using the ADO ActiveX Control</H3><P>There are two different ways in which you can use the ADO control in your VisualC++ applications. The simple way to incorporate ADO into your application is throughthe use of ActiveX controls. You can add the ADO data control to your Visual C++project, just like any other ActiveX control, as shown in Figure 15.1.</P><P><A HREF="javascript:popUp('15fig01.gif')"><B>FIGURE 15.1.</B></A><B> </B><I>Addingthe ADO ActiveX control to a project.</I></P><P>Once you add the ADO control to your project, and place it on a window, you'llneed to specify the data connection in the control properties, as shown in Figure15.2. You'll also need to specify the source for the records that will be retrievedby the control, as shown in Figure 15.3.</P><P><A HREF="javascript:popUp('15fig02.gif')"><B>FIGURE 15.2.</B></A><B> </B><I>Specifyingthe database connection.</I></P><P><A HREF="javascript:popUp('15fig03.gif')"><B>FIGURE 15.3.</B></A><B> </B><I>Specifyingthe record source.</I></P><P>To use the ADO control efficiently, you'll also want to use data-bound controlsthat are ADO-enabled, such as the Microsoft DataGrid control. When you add thesecontrols to the window with the ADO control, you'll specify the ADO control as thedata source for the control, as shown in Figure 15.4. If the control is designedto only provide access to a single field in a record set, you'll also need to specifywhich field is to be used for the control.</P><P><A HREF="javascript:popUp('15fig04.gif')"><B>FIGURE 15.4.</B></A><B> </B><I>Specifyingthe data source.</I></P><P>Once you add all these controls to the window and configure them, you can runyour application and have full database access through ADO without having writtena single line of code, as shown in Figure 15.5.</P><P><A HREF="javascript:popUp('15fig05.gif')"><B>FIGURE 15.5.</B></A><B> </B><I>Arunning ADO control database application.</I></P><P>This is such a simple way to build database applications: Just place controlson a window and configure the properties to tell it where to get the data. What'sthe downside of building ADO applications this way? First, using this approach involvesa lot of unnecessary overhead in building ADO applications. For each SQL query ortable that you want to pull in a separate record set, you have to add a separateADO control. Each of these ADO controls will establish a separate connection to thedatabase, which could cause problems with databases that have a limited number ofconnections available (not to mention the additional overhead on the application).Finally, not all data-bound controls are ADO enabled. ADO is such a new technologythat there are few controls that you can use with it at this time. You may find somecontrols that allow you to retrieve and display data for the user, but do not allowthe user to change and edit the data. Others may not even provide you with that muchfunctionality.</P><P><H3><A NAME="Heading4"></A>Importing the ADO DLL</H3><P>If you look around in the MFC class hierarchy, you'll find that there are no classes

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人自拍视频在线观看| 精品av综合导航| 精品va天堂亚洲国产| 亚洲精选视频免费看| 激情亚洲综合在线| 91国产视频在线观看| 国产免费观看久久| 久久精品国产成人一区二区三区| 一本一道久久a久久精品| 精品国产一区二区三区久久久蜜月 | 日韩激情一区二区| 99国产精品久久久久| 久久久久国产成人精品亚洲午夜| 日韩制服丝袜av| 色八戒一区二区三区| 国产精品女主播av| 国产91高潮流白浆在线麻豆| 欧美sm美女调教| 日韩精品乱码免费| 欧美丰满一区二区免费视频| 《视频一区视频二区| av在线综合网| 国产精品久久久久久久久免费桃花| 韩国精品久久久| 精品理论电影在线观看| 日韩电影一二三区| 欧美一区二区三区四区久久| 午夜视频在线观看一区| 欧美日韩午夜在线视频| 亚洲成人av在线电影| 欧美日韩精品福利| 日韩成人精品在线| 精品免费国产二区三区| 黄页网站大全一区二区| 国产片一区二区| 成人黄色软件下载| 夜夜精品视频一区二区| 欧美午夜精品一区二区三区| 亚洲成人激情综合网| 91精品国产91热久久久做人人| 视频在线观看91| 精品国产乱码91久久久久久网站| 国内精品视频666| 久久久精品中文字幕麻豆发布| 国产福利91精品一区| 国产精品福利影院| 91福利视频网站| 午夜精品一区二区三区三上悠亚| 91麻豆精品国产91久久久久| 久久国产人妖系列| 国产精品―色哟哟| 欧美亚州韩日在线看免费版国语版| 亚洲国产成人91porn| 日韩亚洲电影在线| 国产91精品一区二区| 亚洲欧美一区二区三区国产精品 | 亚洲制服丝袜av| 欧美一区二区视频网站| 国产成人精品免费网站| 一区二区三区在线视频观看58| 3atv在线一区二区三区| 国产成人av电影| 亚洲福利视频一区| 国产午夜精品一区二区三区嫩草| 一本到不卡精品视频在线观看| 日韩中文字幕不卡| |精品福利一区二区三区| 91精品中文字幕一区二区三区| 国产v日产∨综合v精品视频| 亚洲午夜激情网页| 欧美激情艳妇裸体舞| 欧美欧美欧美欧美| 97超碰欧美中文字幕| 青青草国产精品亚洲专区无| 国产精品免费久久| 日韩精品一区二区三区四区视频 | 国产一区二区三区在线看麻豆| 成人欧美一区二区三区黑人麻豆 | 在线成人av网站| 成人av午夜影院| 久久成人麻豆午夜电影| 亚洲精品久久7777| 中文字幕欧美国产| 欧美成人精精品一区二区频| 欧美在线一区二区三区| 岛国精品在线观看| 国产一区三区三区| 欧美a级一区二区| 午夜精品福利一区二区三区av| 国产精品初高中害羞小美女文| 欧美mv和日韩mv的网站| 欧美另类高清zo欧美| 欧美专区日韩专区| 91麻豆自制传媒国产之光| 国产成人av网站| 精品亚洲成a人在线观看| 日韩成人dvd| 日本在线不卡视频| 亚洲成人免费观看| 亚洲成人先锋电影| 亚洲国产欧美一区二区三区丁香婷| 国产精品三级av在线播放| 国产欧美综合在线观看第十页| 欧美mv日韩mv亚洲| 精品国产三级a在线观看| 日韩一区二区视频| 欧美年轻男男videosbes| 欧美色图激情小说| 欧美主播一区二区三区美女| 色诱亚洲精品久久久久久| av一区二区三区在线| 99久久777色| 色综合久久中文综合久久97| 成人激情免费网站| 99国产精品国产精品毛片| 91在线精品秘密一区二区| 91浏览器在线视频| 欧美日韩在线三级| 日韩一区二区在线看| 精品国产91亚洲一区二区三区婷婷| 日韩精品一区二区三区蜜臀| 欧美精品一区二区蜜臀亚洲| 2023国产一二三区日本精品2022| 亚洲精品一区二区精华| 欧美国产综合一区二区| 国产精品乱人伦| 亚洲一线二线三线久久久| 亚洲大片精品永久免费| 捆绑调教美女网站视频一区| 国产一区二区主播在线| av动漫一区二区| 欧美性大战久久久久久久蜜臀 | 在线观看欧美精品| 欧美男人的天堂一二区| 日韩精品影音先锋| 亚洲国产精品成人综合| 亚洲精选免费视频| 麻豆国产91在线播放| 国产成人精品免费网站| 在线精品视频免费播放| 精品人伦一区二区色婷婷| 国产精品色婷婷久久58| 婷婷成人综合网| 成人免费看黄yyy456| 欧美日韩不卡一区| 国产视频911| 五月激情六月综合| 国产成+人+日韩+欧美+亚洲| 欧美探花视频资源| 久久精品男人天堂av| 亚洲成人免费影院| 成人激情av网| 欧美mv和日韩mv国产网站| 亚洲欧美aⅴ...| 国产一区二区精品久久| 欧美日韩在线播放三区四区| 国产日韩精品视频一区| 亚洲123区在线观看| 99久久久无码国产精品| 日韩欧美自拍偷拍| 亚洲电影第三页| 成人av中文字幕| 久久先锋影音av| 午夜电影一区二区三区| eeuss影院一区二区三区| 欧美一区二区三区公司| 一区二区三区影院| 成人黄色软件下载| 久久综合色8888| 秋霞影院一区二区| 精品视频免费在线| 亚洲图片激情小说| 国产成人av一区| 26uuu国产日韩综合| 日韩avvvv在线播放| 99视频一区二区三区| 久久精品一二三| 国产呦萝稀缺另类资源| 日韩美女一区二区三区四区| 亚洲bt欧美bt精品| 欧美系列日韩一区| 一区二区免费在线| 91成人在线精品| 亚洲精品v日韩精品| 91在线精品一区二区三区| 欧美激情综合在线| 成人一级片网址| 国产视频一区二区在线| 国产精品 欧美精品| 亚洲午夜精品网| 成人爱爱电影网址| 国产精品网站一区| 成人性生交大合| 国产精品免费aⅴ片在线观看| 国产毛片精品一区| 久久精品视频免费| 成人一级黄色片| 亚洲天堂福利av| 91小视频在线观看| 亚洲综合色噜噜狠狠|