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

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

?? ch14.htm

?? 21天學會VC的英文版
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Move		</TD>		<TD ALIGN="LEFT">Can be used to move a specific number of records from the current record or from			the first record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">SetAbsolutePosition		</TD>		<TD ALIGN="LEFT">Moves to the specified record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IsBOF		</TD>		<TD ALIGN="LEFT">Returns TRUE if the current record is the first record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IsEOF		</TD>		<TD ALIGN="LEFT">Returns TRUE if the current record is the last record in the set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">GetRecordCount		</TD>		<TD ALIGN="LEFT">Returns the number of records in the set.		</TD>	</TR></TABLE></P><P>Of all of these navigation and informational functions, only two, Move and SetAbsolutePosition,take any arguments. The SetAbsolutePosition function takes a single numeric argumentto specify the row number of the record toward which to navigate. If you pass 0,it navigates to the beginning-of-file (BOF) position, whereas 1 takes you to thefirst record in the set. You can pass negative numbers to this function to causeit to count backward from the last record in the set. (For example, -1 takes youto the last record in the set, -2 to the next-to-last record, and so on.)</P><P>The Move function takes two arguments. The first argument is the number of rowsto move. This can be a positive or negative number; a negative number indicates abackward navigation through the record set. The second argument specifies how youwill move through the set of rows. The possible values for the second argument arelisted in Table 14.4 with descriptions of how they affect the navigation.</P><P><H4>TABLE 14.4. MOVE NAVIGATION 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">SQL_FETCH_RELATIVE		</TD>		<TD ALIGN="LEFT">Moves the specified number of rows from the current row.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">SQL_FETCH_NEXT		</TD>		<TD ALIGN="LEFT">Moves to the next row, ignoring the number of rows specified. The same as calling			the MoveNext function.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">SQL_FETCH_PRIOR		</TD>		<TD ALIGN="LEFT">Moves to the previous row, ignoring the number of rows specified. The same as calling			the MovePrev function.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">SQL_FETCH_FIRST		</TD>		<TD ALIGN="LEFT">Moves to the first row, ignoring the number of rows specified. The same as calling			the MoveFirst function.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">SQL_FETCH_LAST		</TD>		<TD ALIGN="LEFT">Moves to the last row, ignoring the number of rows specified. The same as calling			the MoveLast function.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">SQL_FETCH_ABSOLUTE		</TD>		<TD ALIGN="LEFT">Moves the specified number of rows from the start of the set of rows. The same as			calling the SetAbsolutePosition function.		</TD>	</TR></TABLE><H4>Adding, Deleting, and Updating Records</H4><P>Navigating a set of records from a database is only part of what you need to beable to do. You also need to be able to add new records to the record set, edit andupdate existing records, and delete records. These actions are all possible throughthe various functions that the CRecordset class provides. The functions that youwill use to provide this functionality to the user are listed in Table 14.5.</P><P><H4>TABLE 14.5. RECORD SET EDITING 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">AddNew		</TD>		<TD ALIGN="LEFT">Adds a new record to the record set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Delete		</TD>		<TD ALIGN="LEFT">Deletes the current record from the record set.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Edit		</TD>		<TD ALIGN="LEFT">Allows the current record to be edited.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Update		</TD>		<TD ALIGN="LEFT">Saves the current changes to the database.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Requery		</TD>		<TD ALIGN="LEFT">Reruns the current SQL query to refresh the record set.		</TD>	</TR></TABLE></P><P>None of these functions takes any arguments. However, some of them require followinga few specific steps to get them to work correctly.</P><P>To add a new record to the database, you can call the AddNew function. The nextthing that you need to do is set default values in any of the fields that requirevalues, such as the key fields. Next, you must call the Update function to add thenew record to the database. If you try to navigate to another record before callingthe Update function, the new record will be lost. Once you save the new record, youneed to call the Requery function to refresh the record set so that you can navigateto the new record and let the user edit it. This sequence of function calls typicallylooks like the following:</P><P><PRE>// Add a new record to the record setm_pSet.AddNew();// Set the key field on the new recordm_pSet.m_AddressID = m_lNewID;// Save the new record to the databasem_pSet.Update();// Refresh the record setm_pSet.Requery();// Move to the new recordm_pSet.MoveLast();</PRE><P>When you need to delete the current record, you can simply call the Delete function.Once you delete the current record, you need to navigate to another record so theuser isn't still looking at the record that was just deleted. Once you delete thecurrent record, there is no current record until you navigate to another one. Youdo not need to explicitly call the Update function because the navigation functionscall it for you. This allows you to write the following code to delete the currentrecord:</P><P><PRE>// Delete the current recordm_pSet.Delete();// Move to the previous recordm_pSet.MovePrev();</PRE><P>Finally, to allow the user to edit the current record, you need to call the Editfunction. This allows you to update the fields in the record with the new valuesentered by the user or calculated by your application. Once all changes are madeto the current record, you need to call the Update function to save the changes:</P><P><PRE>// Allow the user to edit the current recordm_pSet.Edit();// Perform all data exchange, updating the fields in the recordset..// Save the user's changes to the current recordm_pSet.Update();</PRE><P>You might be wondering how you get to the fields in the records to update them.When the AppWizard creates the CRecordset-derived class for your application, itadds all the fields in the records that will be in the record set as member variablesin order of the record set class. As a result, you can access the member variablesin order to access and manipulate the data elements in the database records thatare members of the record set.</P><P><H2><A NAME="Heading4"></A>Creating a Database Application Using ODBC</H2><P>For the sample application that you will build today, you'll create an SDI applicationwith ODBC database support. The application will retrieve records from an ODBC database,allowing the user to edit and update any of the records. You'll also add function-ality to enable the user to add new records to the database and to delete recordsfrom the database.</P><P><H3><A NAME="Heading5"></A>Preparing the Database</H3><P>Before you can begin building an application that uses a database, you need adatabase to use with your application. Almost every database that you can purchasefor your applications comes with tools for creating a new database. You'll need touse these tools to create your database and then use the ODBC administrator to configurean ODBC data source for your new database.</P><P>For the sample application in this chapter, I used Access 95 to create a new database.I used the Access Database Wizard to create the database, choosing the Address Bookdatabase template as the database to be created. When the Database Wizard started,I selected the default set of fields for including in the database and selected theoption to include sample data, as shown in Figure 14.1. I then accepted the restof the default settings offered in the Database Wizard.</P><P><A HREF="javascript:popUp('14fig01.gif')"><B>FIGURE 14.1.</B></A><B> </B><I>Includingsample data in the database.</I></P><P>Once you create the database, you need to configure an ODBC data source to pointto the database you just created. To do this, run the ODBC Administrator, which isin the Control Panel on your computer.</P><P>Once in the ODBC Administrator, you'll add a new data source. You can do thisby clicking the Add button, as shown in Figure 14.2. This opens another dialog, whichallows you to select the database driver for the new data source, as shown in Figure14.3. For the sample application that you will build today, because the databasewas created using Access, select the Microsoft Access Driver and click the Finishbutton.</P><P><A HREF="javascript:popUp('14fig03.gif')"><B>FIGURE 14.2.</B></A><B> </B><I>TheODBC Data Source Administrator.</I></P><P><A HREF="javascript:popUp('14fig04.gif')"><B>FIGURE 14.3.</B></A><B> </B><I>TheCreate New Data Source dialog.</I></P><P>In the ODBC Microsoft Access Setup dialog, shown in Figure 14.4, you'll providea short, simple name for the data source. Your application will use this name tospecify the ODBC data source configuration to use for the database connection, soit should reflect the function that the database will be serving, or it should besimilar to the name of the application that will be using this database. For thepurposes of the sample application database, name your data source <B>TYVCDB</B>(for Teach Yourself Visual C++ Database) and enter a description for the databasein the next field.</P><P>Once you enter a name and description for the data source, you need to specifywhere the database is. Click the Select button and then specify the Access databasethat you created. Once you finish configuring the ODBC data source for your database,click the OK button to add the new data source to the ODBC Administrator. You canclick the OK button to finish the task and close the ODBC Administrator because youare now ready to turn your attention to building your application.</P><P><A HREF="javascript:popUp('14fig05.gif')"><B>FIGURE 14.4.</B></A><B> </B><I>TheODBC Microsoft Access 97 Setup dialog.</I></P><P><I></I><H3><A NAME="Heading6"></A>Creating the Application Shell</H3><P>For the sample application that you will build today, you'll create a standardSDI-style application with database support. First, start a new project, selectingthe AppWizard, and give your application a suitable name, such as DbOdbc.</P><P>On the first AppWizard form, specify that you want to build an SDI application.On the second AppWizard form, specify that you want to include Database view withfile support. Click the Data Source button to specify which data source you willuse in your application. In the Database Options dialog, specify that you are usingan ODBC data source, and select the ODBC configuration from the list that you configuredfor your Access database, as shown in Figure 14.5. You can set the record set typeto either Snapshot or Dynaset.</P><P><A HREF="javascript:popUp('14fig06.gif')"><B>FIGURE 14.5.</B></A><B> </B><I>TheDatabase Options dialog.</I></P><P>Once you click the OK button, another dialog opens, presenting you with the availabletables in the database you selected. Select the Addresses table, as shown in Figure14.6, and click the OK button to close this dialog and return to the AppWizard.</P><P>You can continue through the rest of the AppWizard, accepting all of the defaultsettings. When you reach the final AppWizard step, you'll notice that the AppWizardis going to create an extra class. If you select this class, you'll see that it isderived from the CRecordset class, and it is the record set class for your application.You'll also notice that the view class is derived from the CRecordView class, whichis a descendent of the CFormView class, with some added support for database functionality.</P><P><A HREF="javascript:popUp('14fig07.gif')"><B>FIGURE 14.6.</B></A><B> </B><I>TheSelect Database Tables dialog.</I></P><P><I></I><H3><A NAME="Heading7"></A>Designing the Main Form</H3><P>Once you create the application shell, you need to design the main form that willbe used for viewing and editing the database records. You can design this form usingthe standard controls that are part of Visual C++, without adding any special ActiveXcontrols. For designing the main form in your sample application, lay out the mainform as shown in Figure 14.7, and configure the controls with the properties specifiedin Table 14.6.</P><BLOCKQUOTE>	<P><HR><STRONG>TIP:</STRONG> If you want to save a little time when building the example, you can	leave out most of the controls and database fields from the application. The key	fields that you'll need to include are ID, First and Last Names, Birthdate, and Send	Card. If you want to leave out the other fields from the application, that's fine.<HR></BLOCKQUOTE><H4>TABLE 14.6. CONTROL PROPERTY SETTINGS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Object</I></TD>		<TD ALIGN="LEFT"><I>Property</I></TD>		<TD ALIGN="LEFT"><I>Setting</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Static Text		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_STATIC		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Caption		</TD>		<TD ALIGN="LEFT">ID:		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Edit Box		</TD>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久蜜臀精品av| 亚洲午夜精品17c| 国产精选一区二区三区| xnxx国产精品| 国产一区二区福利| 亚洲国产高清aⅴ视频| 成人中文字幕合集| 亚洲人被黑人高潮完整版| 91亚洲精品一区二区乱码| 亚洲激情五月婷婷| 欧美日韩一区二区电影| 免费观看日韩电影| 久久久99精品免费观看| www..com久久爱| 亚洲综合色婷婷| 日韩视频在线你懂得| 激情综合网av| 国产精品萝li| 欧美日本韩国一区| 国产一区二区精品久久99| 中文字幕一区二区5566日韩| 欧美日韩中文精品| 久久99精品国产麻豆婷婷洗澡| 国产夜色精品一区二区av| 99国产精品久久久久久久久久 | 亚洲精品高清在线| 日韩一区二区影院| 成人免费高清在线观看| 亚洲国产精品久久久久秋霞影院| 欧美成人精品3d动漫h| 99视频超级精品| 日韩中文字幕区一区有砖一区| 久久中文娱乐网| 欧洲亚洲精品在线| 国产精品自拍在线| 亚洲成人资源网| 中文字幕va一区二区三区| 欧美美女激情18p| 成人午夜激情在线| 免费成人在线影院| 一区二区三区免费网站| 精品国产91乱码一区二区三区| 北条麻妃一区二区三区| 麻豆国产一区二区| 亚洲人成伊人成综合网小说| 久久新电视剧免费观看| 欧美日韩中文字幕一区| 91理论电影在线观看| 国产精品亚洲一区二区三区妖精 | 91.成人天堂一区| 99久久久久免费精品国产| 精品午夜一区二区三区在线观看 | 无吗不卡中文字幕| 国产喷白浆一区二区三区| 欧美精品一二三区| 日本韩国欧美一区| av在线一区二区| 国产福利一区在线观看| 久久91精品久久久久久秒播| 亚洲成年人影院| 一区二区三区蜜桃网| 亚洲欧美怡红院| 国产欧美精品一区二区色综合| 欧美成va人片在线观看| 制服丝袜在线91| 欧美日韩成人激情| 欧美性三三影院| 一本色道久久综合亚洲aⅴ蜜桃| 国产大陆a不卡| 国产精品一区二区久久不卡| 久久狠狠亚洲综合| 日韩 欧美一区二区三区| 午夜欧美在线一二页| 亚洲一区二三区| 亚洲一区在线播放| 亚洲国产欧美一区二区三区丁香婷| 亚洲桃色在线一区| 自拍偷拍亚洲综合| 亚洲卡通欧美制服中文| 亚洲黄色av一区| 夜色激情一区二区| 夜夜爽夜夜爽精品视频| 一区二区三区加勒比av| 亚洲无人区一区| 亚洲h动漫在线| 免费亚洲电影在线| 精品无人码麻豆乱码1区2区| 精品亚洲成av人在线观看| 国产一区二区三区在线看麻豆| 激情成人午夜视频| 国产不卡视频在线播放| 国产乱人伦偷精品视频免下载| 国产乱码精品一区二区三区五月婷| 极品销魂美女一区二区三区| 高清视频一区二区| 91视视频在线直接观看在线看网页在线看| 成人高清视频在线观看| 色av成人天堂桃色av| 欧美欧美欧美欧美| 精品免费国产一区二区三区四区| 久久亚洲精精品中文字幕早川悠里| 久久香蕉国产线看观看99| 亚洲欧洲日本在线| 亚洲一区二区三区小说| 免费人成在线不卡| 国产成人aaa| 在线看日韩精品电影| 在线不卡中文字幕| 久久久www成人免费毛片麻豆| 国产精品免费视频一区| 亚洲午夜久久久久久久久电影院| 日韩国产欧美三级| 国产成人精品三级| 91视频国产观看| 777a∨成人精品桃花网| 欧美一卡2卡3卡4卡| 91精品国产综合久久精品图片 | 风间由美性色一区二区三区| 福利视频网站一区二区三区| 99久久婷婷国产综合精品电影 | 亚洲成av人**亚洲成av**| 久久99久久久久| 国产精品99久| 色综合久久综合网欧美综合网 | 国产色爱av资源综合区| 国产精品网站一区| 奇米在线7777在线精品| 成人午夜大片免费观看| 欧美做爰猛烈大尺度电影无法无天| 欧美视频在线观看一区二区| 国产三级精品三级| 亚洲最大色网站| 日韩电影免费在线看| 国产乱子伦视频一区二区三区| av午夜精品一区二区三区| 精品一区精品二区高清| 色综合久久中文字幕综合网| 欧美一二三区精品| 中文字幕在线不卡视频| 国产精品免费视频观看| 伊人色综合久久天天| 石原莉奈在线亚洲二区| 麻豆一区二区三| 99精品国产热久久91蜜凸| 日韩欧美一区电影| 亚洲精品中文字幕乱码三区| 日本大胆欧美人术艺术动态 | 色丁香久综合在线久综合在线观看| 欧美猛男超大videosgay| 久久综合给合久久狠狠狠97色69| 国产精品人妖ts系列视频| 最新中文字幕一区二区三区| 日本系列欧美系列| 91丝袜美女网| 日韩一二三四区| 亚洲精品久久7777| 国产一区二区三区四区在线观看| 欧美日韩中文精品| 中文字幕一区二区三区乱码在线| 久久超级碰视频| 91丨porny丨户外露出| 久久综合九色欧美综合狠狠 | 亚洲视频一区在线| 韩国精品主播一区二区在线观看| 岛国精品在线播放| 国产亚洲欧美中文| 美女爽到高潮91| 色国产综合视频| 日本一区二区三区视频视频| 麻豆久久久久久久| 91福利在线免费观看| 国产精品午夜电影| 国产综合久久久久久久久久久久 | 亚洲一区二区三区四区的| 蜜臀久久久久久久| 欧美日本视频在线| 一区二区三区日本| 成人av资源在线| 久久久久久久久蜜桃| 国产一区二区三区日韩| 欧美α欧美αv大片| 免费成人你懂的| 欧美影片第一页| 亚洲愉拍自拍另类高清精品| 9i在线看片成人免费| 国产精品久久久久久久久久久免费看| 亚洲成人激情av| 欧美日韩欧美一区二区| 亚洲国产日韩a在线播放性色| 91亚洲精华国产精华精华液| 国产精品盗摄一区二区三区| 不卡在线观看av| 久久综合色8888| 国产福利一区二区三区| 欧美激情综合在线| 国产精品99久久久久久久女警| 日韩欧美黄色影院| 国产一区二区三区免费播放| 精品盗摄一区二区三区| 精品午夜一区二区三区在线观看 |