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

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

?? ch14.htm

?? 21天學會VC的英文版
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Object</I></TD>		<TD ALIGN="LEFT"><I>Name</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_CBCARD		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_SendCard		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EADDR		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_Address		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ECITY		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_City		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ECOUNTRY		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_Country		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EEMAIL		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_EmailAddress		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EFAX		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_FaxNumber		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EFNAME		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_FirstName		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EHPHONE		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_HomePhone		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EID		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_AddressID		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ELNAME		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_LastName		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ENOTES		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_Notes		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ESNAME		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_SpouseName		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ESTATE		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_StateOrProvince		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EWEXT		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_WorkExtension		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EWPHONE		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_WorkPhone		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EZIP		</TD>		<TD ALIGN="LEFT">m_pSet-&gt;m_PostalCode		</TD>	</TR></TABLE></P><P>You probably noticed when it was time to attach a database field to the birthdatecontrol that the birthday field is missing from the list of database fields. If youlook at the record set class in the class view and expand its tree, you'll noticethat the birthdate field is included as one of the database fields, but it's notavailable in the list of available columns for use with the controls. Double-clickon the birthdate field in the record set class to view its definition. You'll noticethat the m_Birthdate variable is declared as a CTime variable. This is the reasonthat it's not available in the list of database fields that can be attached to controls.There isn't a macro or function you can call for exchanging data between a controland a CTime variable. This is also a problem because the CTime variable type cannothandle dates before December 31, 1969. To use this database field, you'll need tochange its definition from a CTime to a COleDateTime variable type, as in line 17in Listing 14.1. Once you change the variable type of this database field, you willbe able to attach it to the IDC_EDOB control.</P><P><H4>LISTING 14.1. THE DATABASE FIELD VARIABLE DECLARATIONS.</H4><PRE>1:  // Field/Param Data2:      //{{AFX_FIELD(CTestdb5Set, CRecordset)3:      long    m_AddressID;4:      CString    m_FirstName;5:      CString    m_LastName;6:      CString    m_SpouseName;7:      CString    m_Address;8:      CString    m_City;9:      CString    m_StateOrProvince;10:     CString    m_PostalCode;11:     CString    m_Country;12:     CString    m_EmailAddress;13:     CString    m_HomePhone;14:     CString    m_WorkPhone;15:     CString    m_WorkExtension;16:     CString    m_FaxNumber;17:     COleDateTime    m_Birthdate;18:     BOOL    m_SendCard;19:     CString    m_Notes;20: //}}AFX_FIELD</PRE><BLOCKQUOTE>	<P><HR><STRONG>NOTE:</STRONG> Normally, you do not want to edit the portions of code in your applications	that are created and maintained by the various wizards. The change I outline here	is one of the few exceptions to this rule. This obstacle could possibly be considered	a bug in the Visual C++ AppWizard, although it's technically not a bug. You can convert	the date/time database field to sev- eral variable types when creating a class variable	to represent that field. CTime is one of these variable types; COleDateTime is another.	Because these are both equally valid choices, and the functions that populate this	variable can work with either, making this change is possible without dire consequences.<HR></BLOCKQUOTE><P>Once you make the change to the variable type for the m_Birthdate variable inthe record set class (CDbOdbcSet), and attach this database field to the Birthdatecontrol on the form, you might think that you are ready to compile and run your application.Unfortunately, your application will not compile. You'll get a compiler error statingthat the DDX_FieldText cannot convert the COleDateTime variable type. What you needto do is add the code to perform this conversion yourself. Return to the Class Wizardand delete the variable that you added to the IDC_EDOB control. Add a new variableto this control. Specify that the variable is type COleDateTime, and give the variablea name such as m_oledtDOB. Pull up the DoDataExchange function in the view class,CDbOdbcView, into the editor, and add lines 4 through 6 and lines 26 through 28 tothe function, as shown in Listing 14.2.</P><P><H4>LISTING 14.2. THE CDbOdbcView DoDataExchange FUNCTION.</H4><PRE>1:  void CDbOdbcView::DoDataExchange(CDataExchange* pDX)2:  {3:      CRecordView::DoDataExchange(pDX);4:      // Copy the DOB from the record set to the view variable5:      if (pDX-&gt;m_bSaveAndValidate == FALSE)6:          m_oledtDOB = m_pSet-&gt;m_Birthdate;7:      //{{AFX_DATA_MAP(CTestdb5View)8:      DDX_FieldText(pDX, IDC_EID, m_pSet-&gt;m_AddressID, m_pSet);9:      DDX_FieldText(pDX, IDC_EFNAME, m_pSet-&gt;m_FirstName, m_pSet);10:     DDX_FieldText(pDX, IDC_ELNAME, m_pSet-&gt;m_LastName, m_pSet);11:     DDX_FieldText(pDX, IDC_ESNAME, m_pSet-&gt;m_SpouseName, m_pSet);12:     DDX_FieldText(pDX, IDC_ESTATE, m_pSet-&gt;m_StateOrProvince, m_pSet);13:     DDX_FieldText(pDX, IDC_ECITY, m_pSet-&gt;m_City, m_pSet);14:     DDX_FieldText(pDX, IDC_EADDR, m_pSet-&gt;m_Address, m_pSet);15:     DDX_FieldCheck(pDX, IDC_CBCARD, m_pSet-&gt;m_SendCard, m_pSet);16:     DDX_FieldText(pDX, IDC_ECOUNTRY, m_pSet-&gt;m_Country, m_pSet);17:     DDX_FieldText(pDX, IDC_EEMAIL, m_pSet-&gt;m_EmailAddress, m_pSet);18:     DDX_FieldText(pDX, IDC_EFAX, m_pSet-&gt;m_FaxNumber, m_pSet);19:     DDX_FieldText(pDX, IDC_EHPHONE, m_pSet-&gt;m_HomePhone, m_pSet);20:     DDX_FieldText(pDX, IDC_ENOTES, m_pSet-&gt;m_Notes, m_pSet);21:     DDX_FieldText(pDX, IDC_EWEXT, m_pSet-&gt;m_WorkExtension, m_pSet);22:     DDX_FieldText(pDX, IDC_EWPHONE, m_pSet-&gt;m_WorkPhone, m_pSet);23:     DDX_FieldText(pDX, IDC_EZIP, m_pSet-&gt;m_PostalCode, m_pSet);24:     DDX_Text(pDX, IDC_EDOB, m_oledtDOB);25:     //}}AFX_DATA_MAP26:     // Copy the DOB variable back from the view variable to the record         &Acirc;set27:     if (pDX-&gt;m_bSaveAndValidate == TRUE)28:         m_pSet-&gt;m_Birthdate = m_oledtDOB;29: }</PRE><P>In addition to the above change, you have to remove the initialization of them_Birthdate variable in the set class. This is also code that was added by the AppWizard,and once again you have to break the rules by modifying the code that you are neversupposed to touch. To make this change, you can take the simple approach by commentingout the initialization of this variable in the set class constructor, in line 19of Listing 14.3.</P><P><H4>LISTING 14.3. THE CDbOdbcSet CONSTRUCTOR.</H4><PRE>1: CDbOdbcSet::CDbOdbcSet(CDatabase* pdb)2:      : CRecordset(pdb)3:  {4:      //{{AFX_FIELD_INIT(CTestdb5Set)5:      m_AddressID = 0;6:      m_FirstName = _T(&quot;&quot;);7:      m_LastName = _T(&quot;&quot;);8:      m_SpouseName = _T(&quot;&quot;);9:      m_Address = _T(&quot;&quot;);10:     m_City = _T(&quot;&quot;);11:     m_StateOrProvince = _T(&quot;&quot;);12:     m_PostalCode = _T(&quot;&quot;);13:     m_Country = _T(&quot;&quot;);14:     m_EmailAddress = _T(&quot;&quot;);15:     m_HomePhone = _T(&quot;&quot;);16:     m_WorkPhone = _T(&quot;&quot;);17:     m_WorkExtension = _T(&quot;&quot;);18:     m_FaxNumber = _T(&quot;&quot;);19:     //m_Birthdate = 0;20:     m_SendCard = FALSE;21:     m_Notes = _T(&quot;&quot;);22:     m_nFields = 17;23:     //}}AFX_FIELD_INIT24:     m_nDefaultType = dynaset;25: }</PRE><P>Now compile and run your application once again. You'll find that you have a fullyfunctioning database application that retrieves a set of records from the databaseand allows you to scroll through them and make changes to the data, as shown in Figure14.9.</P><P><H3><A NAME="Heading8"></A>Adding New Records</H3><P>You've already created a fully functioning database application without writinga single line of code. However, a few functions are missing. Most database applicationslet the user add new records to the database. To add a new record to the database,you'll want to figure out what the next ID number should be, so you'll scroll tothe last record in the set to get the ID and then increment it by one. Next, you'llcall the AddNew function to add a new record, set the ID field to the new ID youcalculated, and then call the Update function to save the new record. Finally, you'llcall the Requery function to refresh the set of records and then scroll to the lastrecord in the set to let the user enter data into the new record.</P><P><A HREF="javascript:popUp('14fig10.gif')"><B>FIGURE 14.9.</B></A><B> </B><I>Therunning appli- cation.</I></P><BLOCKQUOTE>	<P><HR><STRONG>TIP:</STRONG> Because the ID field in the database in defined as an AutoIncrement	field, you do not normally specify your own ID for the field. However, because the	record set is creating a new record with the ID field, you need to assign a valid	ID to the record or you won't be able to add it to the database. The method used	in this application will not work with any multiuser database because each person	would generate the same IDs for new records. In this situation, a centralized method	for generating new IDs, such as a counter field in the database, is a better solution.	The other option is to create a SQL statement to insert a new record into the database	that was missing the ID field. This allows the auto-increment functionality to work	correctly.<HR></BLOCKQUOTE><P>To add this functionality to your application, start by adding a function to yourrecord set class to determine the next ID number to be used. Add a member functionto the record set class, CDbOdbcSet. Specify the function type as long, the functiondeclaration as GetMaxID, and the access as public. Edit the function, adding thecode in Listing 14.4.</P><P><H4>LISTING 14.4. THE CDbOdbcSet GetMaxID FUNCTION.</H4><PRE>1: long CDbOdbcSet::GetMaxID()2: {3:     // Move to the last record4:     MoveLast();5:     // return the ID of this record6:     return m_AddressID;7: }</PRE><P>Next, you'll need a menu entry that the user can select to add a new record tothe database. Add a new menu entry to the Record menu. Configure the new menu entrywith the properties in Table 14.8.</P><P><H4>TABLE 14.8. MENU 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">Menu Entry		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDM_RECORD_NEW		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Caption		</TD>		<TD ALIGN="LEFT">N&amp;ew Record		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Prompt		</TD>		<TD ALIGN="LEFT">Add a new record\nNew Record		</TD>	</TR></TABLE></P><P>Using the Class Wizard, add an event-handler function for the COMMAND event messagefor this menu to the view class, CDbOdbcView. Edit this function, adding the codein Listing 14.5.</P><P><H4>LISTING 14.5. THE CDbOdbcView OnRecordNew FUNCTION.</H4>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
舔着乳尖日韩一区| 高清不卡在线观看| 大陆成人av片| 国产午夜精品久久久久久久| 日韩黄色片在线观看| 欧美亚洲另类激情小说| 国产精品乱人伦中文| 国产91精品入口| 亚洲精品一区二区三区四区高清| 亚洲妇女屁股眼交7| 99re热这里只有精品免费视频| 久久综合九色综合欧美98| 蜜桃在线一区二区三区| 3d成人h动漫网站入口| 日本亚洲视频在线| 精品日韩一区二区| 国产成人免费视频精品含羞草妖精| 久久亚洲免费视频| 不卡一区二区中文字幕| 亚洲一区二区三区自拍| 7878成人国产在线观看| 精品一区二区三区欧美| 中文字幕av一区二区三区高| 色香蕉久久蜜桃| 久久99精品久久久久久久久久久久| 日韩欧美国产精品一区| 国产一区二区三区在线看麻豆| 国产亚洲自拍一区| 色悠悠亚洲一区二区| 久久99精品网久久| 一区二区免费视频| 337p粉嫩大胆色噜噜噜噜亚洲| 99久精品国产| 精品一区二区三区在线播放| 亚洲视频一二区| 久久综合久久综合亚洲| 欧美在线看片a免费观看| 国产成人亚洲精品青草天美| 亚洲激情图片qvod| 国产欧美日韩精品一区| 欧美久久久久久久久中文字幕| 国产999精品久久| 日本特黄久久久高潮| 亚洲福利一二三区| 亚洲伦理在线精品| 国产精品午夜免费| 久久看人人爽人人| 日韩精品最新网址| 欧美美女直播网站| 一本色道久久综合精品竹菊| 国产91高潮流白浆在线麻豆| 国模套图日韩精品一区二区| 日本女优在线视频一区二区| 亚洲国产精品久久人人爱蜜臀| 中文字幕高清不卡| 日本一区二区视频在线观看| 国产欧美视频一区二区| 久久久久9999亚洲精品| 国产欧美日韩另类视频免费观看 | 精一区二区三区| 麻豆精品国产传媒mv男同| 青青草伊人久久| 麻豆成人久久精品二区三区红 | 色狠狠一区二区| 久久天堂av综合合色蜜桃网| 精品少妇一区二区三区日产乱码| 欧美mv日韩mv| 亚洲综合一区二区| 亚洲精品国产精华液| 亚洲国产日韩综合久久精品| 日韩中文字幕一区二区三区| 免费久久精品视频| 波多野结衣一区二区三区 | 91色九色蝌蚪| 欧美日韩精品三区| 精品av综合导航| 国产精品第四页| 偷拍一区二区三区| 国产成人免费视频网站高清观看视频| 91美女片黄在线观看91美女| 7878成人国产在线观看| 椎名由奈av一区二区三区| 日韩中文字幕91| 91亚洲国产成人精品一区二三 | 国产福利91精品一区二区三区| 波多野结衣亚洲| 久久久久久久久久久黄色| 一区二区三区四区av| 国产在线视频一区二区| 一道本成人在线| 久久嫩草精品久久久精品一| 亚瑟在线精品视频| 91同城在线观看| 国产精品免费视频网站| 精品一区二区在线播放| 91精品国产色综合久久久蜜香臀| 亚洲三级小视频| 99九九99九九九视频精品| wwww国产精品欧美| 美脚の诱脚舐め脚责91 | 欧美三级日韩三级| 一区二区视频在线| 91久久精品一区二区三| 日韩精品国产精品| 日韩欧美精品在线| 一区二区成人在线| 欧美影片第一页| 一区二区在线观看免费视频播放| 91在线观看污| 一区二区成人在线| 欧美一区二区三区成人| 欧美bbbbb| 国产欧美精品区一区二区三区| 久久成人免费电影| 中文字幕乱码亚洲精品一区| 92精品国产成人观看免费 | 国产精品国产三级国产三级人妇 | 久久免费视频一区| 国产成a人无v码亚洲福利| 亚洲日本在线观看| 日韩一级黄色片| 成人爽a毛片一区二区免费| 日韩美女视频一区二区| 91成人看片片| 国产精华液一区二区三区| 亚洲女人小视频在线观看| 欧美精品日日鲁夜夜添| 国产麻豆精品在线| 亚洲电影一级黄| 国产精品久久久久久久久免费丝袜| 日本丶国产丶欧美色综合| 高清不卡在线观看| 亚洲一区二区三区四区在线| 欧美成人欧美edvon| 色婷婷亚洲婷婷| 国产一区二区剧情av在线| 综合久久国产九一剧情麻豆| 欧美大片在线观看一区二区| 91丨九色丨国产丨porny| 久久99在线观看| 亚洲成人动漫精品| 一区二区免费在线播放| 国产精品无遮挡| 久久这里都是精品| 日韩女优av电影| 日韩免费观看高清完整版| 成人福利视频在线看| 日韩欧美中文一区二区| 日一区二区三区| 成人免费一区二区三区在线观看| 精品日韩成人av| 日韩丝袜情趣美女图片| 51精品秘密在线观看| 欧美精品免费视频| 欧美天堂一区二区三区| 色狠狠av一区二区三区| 色婷婷精品大视频在线蜜桃视频| 丁香婷婷综合色啪| 99国产精品视频免费观看| 成人av集中营| 欧美性色aⅴ视频一区日韩精品| 久久久九九九九| 97成人超碰视| 久久aⅴ国产欧美74aaa| 26uuu国产一区二区三区| www.亚洲精品| 国产精品一二三四| 日本成人在线看| 国产精品系列在线播放| 国产·精品毛片| 精品视频1区2区| 久久人人爽人人爽| 一区二区三区四区国产精品| 男男视频亚洲欧美| 97se狠狠狠综合亚洲狠狠| 日韩欧美在线综合网| 亚洲同性gay激情无套| 免费在线观看日韩欧美| 波波电影院一区二区三区| 欧美一级日韩免费不卡| 成人免费小视频| 国产乱码字幕精品高清av| 欧美色电影在线| 亚洲视频一区二区在线观看| 日本一道高清亚洲日美韩| 色综合久久六月婷婷中文字幕| 精品剧情v国产在线观看在线| 亚洲精品国产一区二区三区四区在线| 蜜臀av性久久久久蜜臀aⅴ| 欧美特级限制片免费在线观看| 国产欧美日韩在线看| 国产在线不卡一卡二卡三卡四卡| 欧美性色欧美a在线播放| 综合在线观看色| 国产69精品久久久久777| 亚洲精品在线三区| 精品在线一区二区| 欧美xingq一区二区| 精品一区二区久久| 日韩精品一区二区三区在线观看|