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

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

?? ch22.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 4 頁
字號:

<DL>
	<DT><I></I></DT>
	<DD><B>5. </B>Click the Select button. The Select Database file selector appears.
	Use the selector to locate and select the DeptStore.mdb file (see Figure 22.7).
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc07.gif')"><B>FIG. 22.7</B></A><B> </B><I>Browse
your way to the .mdb file that holds your data.</I></P>
<P>

<DL>
	<DT><I></I></DT>
	<DD><B>6. </B>Click OK to finalize the database selection and then, in the ODBC Microsoft
	Access 97 Setup dialog box, click OK to finalize the data-source creation process.
	Finally, click OK in the ODBC Data Source Administrator dialog box and close the
	Control Panel.
	<P>
</DL>

<P>Your system is now set up to access the DeptStore.mdb database file with the Microsoft
Access ODBC driver.</P>
<P>
<H3><A NAME="Heading8"></A>Creating the Basic Employee Application</H3>
<P>Now that you have created and registered your data source, it's time to create
the basic Employee application. The steps that follow lead you through this process.
After you complete these steps, you will have an application that can access and
view the Employees table of the Department Store database:</P>

<DL>
	<DD><B>1. </B>Select File, New from Developer Studio's menu bar. Click the Projects
	tab.
	<P>
	<DT></DT>
	<DD><B>2. </B>Select MFC AppWizard (exe) and type <B>Employee</B> in the Project
	Name box, as shown in Figure 22.8. Click OK. The Step 1 dialog box appears.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc08.gif')"><B>FIG. 22.8</B></A><B> </B><I>Create
an ordinary MFC application with AppWizard.</I></P>
<P>

<DL>
	<DT><I></I></DT>
	<DD><B>3. </B>Select Single Document, as shown in Figure 22.9, to ensure that the
	Employee application doesn't allow more than one window to be open at a time. Click
	Next.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc09.gif')"><B>FIG. 22.9</B></A><B> </B><I>Create
a single- document application.</I></P>
<P>

<DL>
	<DD><B>4. </B>Select the Database View Without File Support option, as shown in Figure
	22.10, so that AppWizard will generate the classes you need in order to view the
	contents of a database. This application will not use any supplemental files besides
	the database, so it doesn't need file (serializing) support. Click the Data Source
	button to connect the application to the data source you set up earlier.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc10.gif')"><B>FIG. 22.10</B></A><B> </B><I>Arrange
for a database view but no other file support.</I></P>
<P>

<DL>
	<DD><B>5. </B>In the Database Options dialog box, drop down the ODBC list and select
	the Department Store data source, as shown in Figure 22.11. Click OK.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc11.gif')"><B>FIG. 22.11</B></A><B> </B><I>Choose
the Department Store data source.</I></P>
<P>

<DL>
	<DD><B>6. </B>In the Select Database Tables dialog box, select the Employees table,
	as shown in Figure 22.12, and click OK. The Step 2 dialog box reappears, filled in
	as shown in Figure 22.13.
	<P>
	<DT></DT>
	<DD>You've now associated the Employees table of the Department Store data source
	with the Employee application. Click Next to move to Step 3.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc12.gif')"><B>FIG. 22.12</B></A><B> </B><I>Select
which tables from the data source you want to use in this application.</I></P>
<P>

<DL>
	<DT><I></I></DT>
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc13.gif')"><B>FIG. 22.13</B></A><B> </B><I>After
selecting the data source, the Step 2 dialog box looks like this.</I></P>
<P>

<DL>
	<DD><B>7. </B>Accept the default (None) no compound document support and click Next.
	<P>
	<DT></DT>
	<DD><B>8. </B>In the Step 4 dialog box, turn off the Printing and Print Preview option
	so that the dialog box resembles Figure 22.14. Click Next.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc14.gif')"><B>FIG. 22.14</B></A><B> </B><I>Turn
off print support.</I></P>
<P>

<DL>
	<DD><B>9. </B>Accept the defaults for Step 5 by clicking Next. In Step 6, click Finish
	to finalize your selections for the Employee application. Figure 22.15 shows the
	New Project Information dialog box that appears.
	<P>
	<DT></DT>
	<DD><B>10. </B>Click OK, and AppWizard creates the basic Employee application.
	<P>
</DL>

<P>At this point, you can compile the application by clicking the Build button on
Developer Studio's toolbar, by selecting the Build, Build command from the menu bar,
or by pressing F7 on your keyboard. After the program has compiled, select the Build,
Execute command from the menu bar or press Ctrl+F5 to run the program. When you do,
you see the window shown in Figure 22.16. You can use the database controls in the
application's toolbar to navigate from one record in the Employee table to another.
However, nothing appears in the window because you've yet to associate controls with
the fields in the table that you want to view. You will do that in the following
section.</P>
<P><A HREF="javascript:popUp('22uvc15.gif')"><B>FIG. 22.15</B></A><B> </B><I>The
application summary mentions the data source as well as the usual information.</I></P>
<P><A HREF="javascript:popUp('22uvc16.gif')"><B>FIG. 22.16</B></A><B> </B><I>The
basic Employee application looks nice but doesn't do much.</I></P>
<H3><I></I></H3>
<H3><A NAME="Heading9"></A>Creating the Database Display</H3>
<P>The next step in creating the Employee database application is to modify the form
that displays data in the application's window. Because this form is just a special
type of dialog box, it's easy to modify with Developer Studio's resource editor,
as you will discover while completing the following steps:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>In the workspace window, select the Resource View tab to display the
	application's resources.
	<P>
	<DT></DT>
	<DD><B>2. </B>Open the resource tree by clicking + next to the Employee resources
	folder. Then, open the Dialog resource folder the same way. Double-click the IDD_EMPLOYEE_FORM
	dialog box ID to open the dialog box into the resource editor, as shown in Figure
	22.17.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc17.gif')"><B>FIG. 22.17</B></A><B> </B><I>Open
the dialog box in the resource editor.</I></P>
<P>

<DL>
	<DD><B>3. </B>Click the static string in the center of the dialog box to select it,
	and then press the Delete key to remove the string from the dialog box.
	<P>
	<DT></DT>
	<DD><B>4. </B>Use the dialog box editor's tools to create the dialog box, shown in
	Figure 22.18, by adding edit boxes and static labels. (Editing dialog boxes is introduced
	in Chapter 2, &quot;Dialogs and Controls.&quot;) Give the edit boxes the following
	IDs: <B>IDC_EMPLOYEE_ID</B>, <B>IDC_EMPLOYEE_NAME</B>, <B>IDC_EMPLOYEE_RATE</B>,
	and <B>IDC_EMPLOYEE_DEPT</B>. Set the Read-Only style (found on the Styles page of
	the Edit Properties property sheet) of the IDC_EMPLOYEE_ID edit box.
	<P>
	<DT></DT>
	<DD>Each of these edit boxes will represent a field of data in the database. The
	first edit box is read-only because it will hold the database's primary key, which
	should never be modified.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc18.gif')"><B>FIG. 22.18</B></A><B> </B><I>Create
a dialog box to be used in your database form.</I></P>
<P>

<DL>
	<DD><B>5. </B>Choose View, ClassWizard to open ClassWizard, and click the Member
	Variables tab.
	<P>
	<DT></DT>
	<DD><B>6. </B>With the IDC_EMPLOYEE_DEPT resource ID selected, click the Add Variable
	button. The Add Member Variable dialog box appears.
	<P>
	<DT></DT>
	<DD><B>7. </B>Click the arrow next to the Member Variable Name drop-down list and
	select m_pSet-&gt;m_DeptID, as shown in Figure 22.19. Leave the type as CString and
	click OK to add the variable.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc19.gif')"><B>FIG. 22.19</B></A><B> </B><I>Connect
the IDC_EMPLOYEE_DEPT control with the m_DeptID member variable of the recordset.</I></P>
<P>

<DL>
	<DD><B>8. </B>Associate other member variables (m_pSet-&gt;EmployeeID, m_pSet-&gt;EmployeeName,
	and m_pSet-&gt;EmployeeRate) with the edit controls in the same way. When you're
	finished, the Member Variables page of the MFC ClassWizard property sheet will look
	like Figure 22.20.
	<P>
	<DT></DT>
	<DD>By selecting member variables of the application's CEmployeeSet class (derived
	from MFC's CRecordset class) as member variables for the controls in Database view,
	you're establishing a connection through which data can flow between the controls
	and the data source.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc20.gif')"><B>FIG. 22.20</B></A><B> </B><I>All
four controls are connected to member variables.</I></P>

<DL>
	<DD><B>9. </B>Click the OK button in the MFC ClassWizard property sheet to finalize
	your changes.
	<P>
</DL>

<P>You've now created a data display form for the Employee application. Build and
execute the program again, and you will see the window shown in Figure 22.21. Now
the application displays the contents of records in the Employee database table.
Use the database controls in the application's toolbar to navigate from one record
in the Employee table to another.</P>
<P><A HREF="javascript:popUp('22uvc21.gif')"><B>FIG. 22.21</B></A><B> </B><I>The
Employee application now displays data in its window.</I></P>
<P>After you've examined the database, try updating a record. To do this, simply
change one of the record's fields (except the employee ID, which is the table's primary
key and can't be edited). When you move to another record, the application automatically
updates the modified record. The commands in the application's Record menu also enable
you to navigate through the records in the same manner as the toolbar buttons.</P>
<P>Notice that you've created a sophisticated database-access program without writing
a single line of C++ code--an amazing feat. Still, the Employee application is limited.
For example, it can't add or delete records. As you may have guessed, that's the
next piece of the database puzzle, which you will add.</P>
<P>
<H3><A NAME="Heading10"></A>Adding and Deleting Records</H3>
<P>When you can add and delete records from a database table, you will have a full-featured
program for manipulating a flat (that is, not a relational) database. In this case,
the flat database is the Employees table of the Department Store relational database.
Adding and deleting records in a database table is an easier process than you might
believe, thanks to Visual C++'s CRecordView and CRecordSet classes, which provide
all the member functions you need in order to accomplish these common database tasks.
You will need to add some menu items to the application, as first discussed in Chapter
8, &quot;Building a Complete Application: ShowString.&quot; Follow these steps to
include add and delete commands in the Employee application:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Select the ResourceView tab, open the Menu folder, and double-click
	the IDR_MAINFRAME menu ID. The menu editor appears, as shown in Figure 22.22.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc22.gif')"><B>FIG. 22.22</B></A><B> </B><I>Developer
Studio's menu editor is in the pane on the right.</I></P>
<P>

<DL>
	<DD><B>2. </B>Click the Record menu item to open it, and click the blank menu item
	at the bottom of the menu. Choose View, Properties and pin the Menu Item Properties
	dialog box in place.
	<P>
	<DT></DT>
	<DD><B>3. </B>In the ID edit box, enter <B>ID_RECORD_ADD</B> and in the Caption box,
	enter <B>&amp;Add Record</B>, as shown in Figure 22.23. This adds a new command to
	the Record menu.
	<P>
	<DT></DT>
	<DD><B>4. </B>In the next blank menu item, add a delete command with the ID <B>ID_RECORD_DELETE</B>
	and the caption <B>&amp;Delete Record</B>.
	<P>
</DL>

<P><A HREF="javascript:popUp('22uvc23.gif')"><B>FIG. 22.23</B></A><B> </B><I>Add
a menu item that adds a record to the Employee table.</I></P>
<P>Next, you will connect these commands to toolbar buttons, as first discussed in
Chapter 9, &quot;Status Bars and Toolbars.&quot; Follow these steps:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>In the ResourceView pane, open the Toolbar folder and then double-click
	the IDR_MAINFRAME ID. The application's toolbar appears in the resource editor.
	<P>
	<DT></DT>
	<DD><B>2. </B>Click the blank toolbar button to select it, and then use the editor's
	tools to draw a red plus on the button.
	<P>
	<DT></DT>
	<DD><B>3. </B>Double-click the new button in the toolbar. The Toolbar Button Properties
	property sheet appears. Select ID_RECORD_ADD in the ID box to connect this button

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久中文综合久久97| 精品国产91乱码一区二区三区 | 无码av中文一区二区三区桃花岛| 捆绑调教一区二区三区| 99久久精品一区二区| 日韩欧美一级片| 亚洲va国产va欧美va观看| jvid福利写真一区二区三区| 欧美一区二区视频观看视频| 亚洲精品美腿丝袜| 盗摄精品av一区二区三区| 日韩一区二区三区在线| 亚洲成a人片在线观看中文| av午夜一区麻豆| 日本一区二区三区dvd视频在线| 日本少妇一区二区| 欧美精品日韩一区| 一区二区三区精密机械公司| 成人国产精品免费网站| 国产午夜一区二区三区| 久久 天天综合| 日韩精品一区国产麻豆| 丝袜诱惑制服诱惑色一区在线观看| 99免费精品视频| 国产精品麻豆欧美日韩ww| 国产精品123| 国产色综合久久| 国产精品一区一区三区| 久久久久久久久久久黄色| 久久99国内精品| 欧美大胆人体bbbb| 国产又粗又猛又爽又黄91精品| 日韩女优av电影| 久久国产免费看| 精品欧美黑人一区二区三区| 久久激五月天综合精品| 精品国产一区二区三区av性色| 九九视频精品免费| 精品国产免费久久| 国产91丝袜在线播放九色| 国产三级精品三级在线专区| 风间由美一区二区av101| 国产精品无遮挡| 日本精品一区二区三区高清| 一区二区三区中文在线| 欧美精选一区二区| 久久99精品久久久久久久久久久久| 精品福利av导航| 国产91精品免费| 亚洲综合无码一区二区| 在线播放欧美女士性生活| 六月丁香婷婷色狠狠久久| 国产亚洲一二三区| 日本道精品一区二区三区| 午夜精品影院在线观看| 久久亚洲一区二区三区明星换脸| 国v精品久久久网| 亚洲国产精品天堂| www一区二区| 91视频免费播放| 琪琪一区二区三区| 国产精品久久久久久久裸模 | 亚洲免费伊人电影| 欧美精品久久99久久在免费线| 麻豆国产91在线播放| 亚洲欧洲另类国产综合| 欧美日韩一级大片网址| 韩国欧美一区二区| 亚洲精品日产精品乱码不卡| 精品少妇一区二区三区| 99久久精品国产精品久久| 免费在线观看一区二区三区| 国产精品久久看| 欧美成人官网二区| 在线免费观看视频一区| 精品一区二区三区av| 怡红院av一区二区三区| 精品粉嫩aⅴ一区二区三区四区| 色综合久久久久综合99| 久久精品国产精品青草| 亚洲国产毛片aaaaa无费看| 久久精品夜夜夜夜久久| 欧美日韩国产在线播放网站| 国产91精品精华液一区二区三区| 三级欧美韩日大片在线看| 国产精品国产三级国产有无不卡| 日韩欧美激情在线| 在线观看亚洲精品| 成人免费黄色大片| 精品亚洲国内自在自线福利| 亚洲午夜激情网站| 亚洲欧美日韩在线| 国产女同性恋一区二区| 日韩欧美一区在线| 欧美日本在线播放| 在线视频观看一区| 色呦呦国产精品| 成年人网站91| 国产成人av一区二区| 麻豆视频一区二区| 日精品一区二区| 午夜久久久影院| 亚洲18影院在线观看| 亚洲一级二级在线| 亚洲资源中文字幕| 亚洲精品少妇30p| 国产精品久久夜| 日本一区二区三区高清不卡| 久久久噜噜噜久久中文字幕色伊伊| 欧美一卡二卡在线观看| 91麻豆精品国产91久久久久久久久 | 免费不卡在线视频| 日韩精品亚洲一区| 日韩精品成人一区二区三区| 亚洲精品福利视频网站| 一区二区三区免费观看| 亚洲尤物视频在线| 天天免费综合色| 麻豆精品在线看| 国产成人av电影在线播放| 国产成人日日夜夜| 99精品国产99久久久久久白柏 | 欧美日本在线视频| 日韩视频中午一区| 久久无码av三级| 国产精品久久久久久久岛一牛影视 | jizz一区二区| 色综合色狠狠综合色| 91农村精品一区二区在线| 欧美主播一区二区三区| 88在线观看91蜜桃国自产| 91麻豆精品国产综合久久久久久| 欧美tickling挠脚心丨vk| 久久久.com| 夜夜嗨av一区二区三区四季av| 亚洲在线观看免费视频| 奇米一区二区三区| 国产成人精品亚洲午夜麻豆| a级精品国产片在线观看| 欧美中文字幕不卡| 精品人在线二区三区| 国产精品欧美经典| 日韩激情一区二区| 成人性视频网站| 欧美视频日韩视频| 久久综合九色综合欧美就去吻| 国产精品你懂的在线| 亚洲国产精品精华液网站| 国产尤物一区二区| 欧美三级中文字幕| 精品国产三级a在线观看| 亚洲色图视频网| 蜜桃av噜噜一区| 99久久免费国产| 日韩免费电影网站| 亚洲综合视频在线观看| 国产在线精品一区二区夜色| 91麻豆国产在线观看| 精品欧美一区二区在线观看| 尤物av一区二区| 国产成人免费视频网站| 欧美精品国产精品| 1024亚洲合集| 九一九一国产精品| 欧美二区在线观看| 亚洲日本成人在线观看| 精品中文字幕一区二区小辣椒 | 亚洲少妇最新在线视频| 精品一区二区三区免费毛片爱 | 日韩精品一二三| 色狠狠色狠狠综合| 亚洲国产精品精华液2区45| 日本美女一区二区三区| 91免费国产视频网站| 久久久午夜精品理论片中文字幕| 亚洲成av人片一区二区| 91原创在线视频| 国产精品丝袜黑色高跟| 激情小说欧美图片| 日韩视频一区在线观看| 亚洲一区免费在线观看| 91麻豆精品在线观看| 中文字幕电影一区| 国产传媒一区在线| 久久九九全国免费| 国内一区二区视频| 精品免费视频.| 久久99国产精品久久99果冻传媒 | 色屁屁一区二区| 中文字幕永久在线不卡| 成人av免费网站| 国产精品第一页第二页第三页| 国产成a人亚洲| 中文字幕精品在线不卡| 国产成人一区在线| 国产精品免费人成网站| 成人视屏免费看| 中文字幕欧美日本乱码一线二线| 成人亚洲精品久久久久软件| 中文字幕欧美激情一区|