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

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

?? ch23.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
	<LI><I>Blue</I> for keywords such as PRINT and SELECT
	<P>
	<LI><I>Green</I> for both styles of comment
	<P>
	<LI><I>Black</I> for other kinds of text
</UL>

<P>To run a stored procedure, choose Tools, Run; or right-click the stored procedure
name in DataView and choose Run; or right-click in the editor and choose Run. The
results appear in the Results pane of the Output window--don't confuse this with
the Results pane of Query Designer. Figure 23.22 shows the Output window stretched
very large to show some results of reptq2.</P>
<P><A HREF="javascript:popUp('23uvc22.gif')"><B>FIG. 23.22</B></A><B> </B><I>You
can see the results of any stored procedure from within Developer Studio.</I></P>
<P>Some stored procedures take parameters. For example, double-click reptq3; its
code looks like this:</P>
<P>
<PRE>CREATE PROCEDURE reptq3 @lolimit money, @hilimit money,
@type char(12)
AS
select pub_id, type, title_id, price
from titles
where price &gt;@lolimit AND price &lt;@hilimit AND type = @type 
      OR type LIKE `%cook%'
order by pub_id, type
COMPUTE count(title_id) BY pub_id, type
</PRE>
<P>This stored procedure takes three parameters: lolimit, hilimit, and type. If you
run it, the dialog box shown in Figure 23.23 appears: Enter parameter values and
click OK to run the procedure. See the results in the Output window.</P>
<P><A HREF="javascript:popUp('23uvc23.gif')"><B>FIG. 23.23</B></A><B> </B><I>Providing
parameters to stored procedures is simple.</I></P>
<P>It might be nice if the type parameter were a drop-down box, enabling you to see
all the type values in the table before submitting the query rather than having to
type business yourself. That sort of capability is exactly what you can build into
a C++ program that uses SQL stored procedures. To see how, in the next section you
will write a new stored procedure and call it from your C++ program.</P>
<P>
<H3><A NAME="Heading10"></A>Writing a New Stored Procedure</H3>
<P>To create a new stored procedure, right-click Stored Procedures in DataView and
choose New Stored Procedure. This code appears in the editor:</P>
<P>
<PRE>Create Procedure /*Procedure_Name*/
As
     return (0)
</PRE>
<P>Edit this code so that it looks like Listing 23.1. Save the stored procedure by
choosing File, Save--there's no need to specify the name because it's in the first
line. After the procedure has been saved, its name appears in the DataView.</P>
<P>
<H4>Listing 23.1&#160;&#160;author_ytd, the New Stored Procedure</H4>
<PRE>CREATE PROCEDURE author_ytd @sales int
AS
SELECT authors.au_lname, authors.au_fname, titles.title, ytd_sales
   FROM authors, titles, titleauthor
   WHERE ytd_sales &gt; @sales 
      AND authors.au_id = titleauthor.au_id 
      AND titleauthor.title_id = titles.title_id
</PRE>
<PRE>ORDER BY ytd_sales DESC
</PRE>
<P>This SQL code gathers information from three tables, using the au_id and title_id
columns to connect authors to titles. It takes one parameter, sales, which is an
integer value. Run the procedure to see the results immediately. Listing 23.2 shows
the results, using 4000 as the value for sales.</P>
<P>
<H4>Listing 23.2&#160;&#160;author_ytd results (@sales = 4000)</H4>
<PRE>Running Stored Procedure dbo.author_ytd ( @sales = 4000 ).
au_lname        au_fname  title                                     ytd_sales
-------------- -------- -------------------------------------------- ------
DeFrance        Michel    The Gourmet Microwave                        22246
Ringer          Anne      The Gourmet Microwave                        22246
Green           Marjorie  You Can Combat Computer Stress!              18722
Blotchet-Halls  Reginald  Fifty Years in Buckingham Palace Kitchens    15096
Carson          Cheryl    But Is It User Friendly?                      8780
Green           Marjorie  The Busy Executive's Database Guide           4095
Bennet          Abraham   The Busy Executive's Database Guide           4095
Straight        Dean      Straight Talk About Computers                 4095
Dull            Ann       Secrets of Silicon Valley                     4095
Hunter          Sheryl    Secrets of Silicon Valley                     4095
O'Leary         Michael   Sushi, Anyone?                                4095
Gringlesby      Burt      Sushi, Anyone?                                4095
Yokomoto        Akiko     Sushi, Anyone?                                4095
White           Johnson   Prolonged Data Deprivation: Four Case Studies 4072
 (14 row(s) affected)
Finished running dbo.author_ytd. 
</PRE>
<PRE>RETURN_VALUE = 0
</PRE>
<H3><A NAME="Heading11"></A>Connecting the Stored Procedure to C++ Code</H3>
<P>At the moment, you have an empty C++ application that uses a recordset and would
display members of that recordset in a record view if you added fields to the dialog
to do so. The recordset contains all the columns from the three tables (authors,
titleauthor, and titles) that you specified during the AppWizard process. That's
arranged by a function called CPublishingSet::GetDefaultSQL() that AppWizard wrote
for you, shown in Listing 23.3.</P>
<P>
<H4>Listing 23.3&#160;&#160;CPublishingSet::GetDefaultSQL() from AppWizard</H4>
<PRE>CString CPublishingSet::GetDefaultSQL()
{
     return _T(&quot;[dbo].[authors],[dbo].[titleauthor],[dbo].[titles]&quot;);
</PRE>
<PRE>}
</PRE>
<P>You're going to change this default SQL so that it calls your stored procedure,
which is now part of the pubs database. First, choose Project, Set Active Project
and select Publishing. Switch to ClassView in the Workspace pane, expand CPublishingSet,
and double-click GetDefaultSQL() to edit it. Replace the code with that in Listing
23.4.</P>
<P>
<H4>Listing 23.4&#160;&#160;CPublishingSet::GetDefaultSQL() to Call Your Stored Procedure</H4>
<PRE>CString CPublishingSet::GetDefaultSQL()
{
     return _T(&quot;{CALL author_ytd(4000)}&quot;);
</PRE>
<PRE>}
</PRE>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong>ormally you would not hard-code the parameter value like this. Adding
	member variables to the class to hold parameters and passing them to the SQL is a
	topic you can explore in the online help when you are more familiar with the Enterprise
	Edition.&#160; 
<HR>


</BLOCKQUOTE>

<P>The records returned from this query will go into your recordset. The query returns
four columns (au_lname, au_fname, title, and ytd_sales), but the recordset is expecting
far more than that. You can use ClassWizard to edit your recordset definition. Follow
these steps:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Open ClassWizard by choosing View, ClassWizard.
	<P>
	<DT></DT>
	<DD><B>2. </B>Click the Member Variables tab. You should see something like Figure
	23.24, showing all the member variables of the recordset connected to table columns.
	<P>
</DL>

<P><A HREF="javascript:popUp('23uvc24.gif')"><B>FIG. 23.24</B></A><B> </B><I>ClassWizard
manages your recordset definition.</I></P>

<DL>
	<DT><I></I></DT>
	<DD><B>3. </B>Highlight [address] and click Delete Variable.
	<P>
	<DT></DT>
	<DD><B>4. </B>In the same way, delete all the variables except au_lname, au_fname,
	title, and ytd_sales.
	<P>
	<DT></DT>
	<DD><B>5. </B>Click OK to close ClassWizard.
	<P>
</DL>

<P>Your application can compile and run now, but until you edit the Record View dialog
box, you won't be able to see the records and columns that are returned by another
query. Editing the dialog box is covered in Chapter 22 and uses skills first demonstrated
in Chapter 2, &quot;Dialogs and Controls,&quot; so the description here will be brief.</P>
<P>Click the ResourceView tab, expand the resources, expand Dialogs, and double-click
IDD_PUBLISHING_FORM. This dialog box was created for you by AppWizard but has no
controls on it yet. Delete the static text reminding you to add controls, and add
four edit boxes and their labels so that the dialog resembles Figure 23.25. Use sensible
resource IDs for the edit boxes, not the defaults provided by Developer Studio. Name
them IDC_QUERY_LNAME, IDC_QUERY_FNAME, IDC_QUERY_TITLE, and IDC_QUERY_YTDSALES.</P>
<P><A HREF="javascript:popUp('23uvc25.gif')"><B>FIG.23.25</B></A><B> </B><I>Edit
your Record View dialog box.</I></P>
<P>There is one task left: Connect these fields to member variables. Here's how to
make that connection:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Open ClassWizard while this dialog box has focus.
	<P>
	<DT></DT>
	<DD><B>2. </B>Click the Member Variables tab.
	<P>
	<DT></DT>
	<DD><B>3. </B>Select IDC_QUERY_FNAME and click Add Variable to open the Add Member
	Variable dialog box.
	<P>
	<DT></DT>
	<DD><B>4. </B>From the drop-down box labeled Member Variable Name, choose m_pSet-&gt;m_au_fname
	and click OK.
	<P>
	<DT></DT>
	<DD><B>5. </B>In the same way, connect IDC_QUERY_LNAME to m_pSet-&gt;m_au_lname,
	IDC_QUERY_TITLE to m_pSet-&gt;m_title, and IDC_QUERY_YTDSALES to m_pSet-&gt;m_ytd_sales.
	<P>
	<DT></DT>
	<DD><B>6. </B>Figure 23.26 shows the ClassWizard dialog box when all four controls
	have been connected. Click OK to close ClassWizard.
	<P>
</DL>

<P>In ClassView, double-click the function DoFieldExchange() under CPublishingSet
and look at the code that was generated for you. The order in which the variables
appear in this code is important: It must match the order in which the fields are
coming back from your stored procedure. Figure 23.27 shows DoFieldExchange() and
the stored procedure together. Adjust the order of the fields in the SELECT statement,
if required.</P>
<P>Build your project and run it. You should see a record view like Figure 23.28
(you might have to go through the SQL login procedure again first), and if you scroll
through the record view with the arrow buttons, you should see every author from
the report in Listing 23.2.</P>
<P><A HREF="javascript:popUp('23uvc26.gif')"><B>FIG. 23.26</B></A><B> </B><I>Connect
the record view controls to member variables of the recordset.</I></P>
<P><A HREF="javascript:popUp('23uvc27.gif')"><B>FIG. 23.27</B></A><B> </B><I>Make
sure that the fields are in the same order in DoFieldExchange() as in your stored
procedure.</I></P>
<P><A HREF="javascript:popUp('23uvc28.gif')"><B>FIG. 23.28</B></A><B> </B><I>Your
application displays the results of the stored procedure's query.</I></P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>TIP:</strong> Make sure you have saved the SQL stored procedure before you build.
	Because the stored procedures are in a subproject of Publishing, building Publishing
	will not trigger any saves in the subproject. 
<HR>


</BLOCKQUOTE>

<P>This application doesn't do much at the moment: It calls a stored procedure and
neatly presents the results. With a little imagination, you can probably see how
your SQL-based C++ programs can wrap stored procedures in user-friendly interfaces

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久久久久久久院品网| 韩国在线一区二区| 国产视频一区在线观看| 3d成人动漫网站| 欧美综合一区二区| 欧美亚洲另类激情小说| 欧美吻胸吃奶大尺度电影 | 午夜精品国产更新| 亚洲专区一二三| 午夜精品一区二区三区免费视频| 一区二区三区精品在线观看| 亚洲综合av网| 五月综合激情日本mⅴ| 亚洲成人免费看| 777色狠狠一区二区三区| 一区二区在线观看免费| 香港成人在线视频| 久久精工是国产品牌吗| 精品一区二区三区久久久| 91美女视频网站| 日韩午夜激情免费电影| 亚洲成人精品一区| 视频一区二区国产| 国产经典欧美精品| 色999日韩国产欧美一区二区| 7777精品伊人久久久大香线蕉经典版下载| 欧美午夜精品久久久久久超碰| 久久久久久一二三区| 欧美日韩午夜影院| 午夜精品视频一区| 一色屋精品亚洲香蕉网站| 一级特黄大欧美久久久| 美女视频黄久久| 国产91色综合久久免费分享| 色婷婷狠狠综合| 日韩一级免费观看| 中文字幕va一区二区三区| 亚洲最大成人综合| 国产黄色精品视频| 欧美日韩高清在线播放| 国产欧美日韩卡一| 亚洲v日本v欧美v久久精品| 国产综合色产在线精品| 91欧美一区二区| 日韩免费观看高清完整版| 《视频一区视频二区| 日本午夜精品视频在线观看 | 国产一区二区三区香蕉| 91无套直看片红桃| 久久影视一区二区| 五月天亚洲精品| 97aⅴ精品视频一二三区| 日韩免费视频一区| 三级久久三级久久| 色视频成人在线观看免| 欧美激情一区二区三区不卡| 免费观看在线综合色| 99re这里只有精品6| 久久精品一区蜜桃臀影院| 日韩av在线播放中文字幕| 一本到三区不卡视频| 国产精品三级电影| 国产激情视频一区二区三区欧美| 91精品免费在线观看| 亚洲成人资源网| 色哟哟日韩精品| 亚洲三级免费电影| jlzzjlzz欧美大全| 国产精品久久久久毛片软件| 国产91丝袜在线18| 国产亚洲一本大道中文在线| 精品一二线国产| 欧美成人福利视频| 精品中文字幕一区二区小辣椒| 欧美日韩不卡在线| 日韩电影免费在线| 欧美一级日韩一级| 久久99国产精品久久99果冻传媒| 欧美大片一区二区| 激情欧美一区二区| 亚洲美女视频在线观看| 91丨porny丨国产| 亚洲免费观看高清完整版在线| 成人免费视频视频在线观看免费| 国产婷婷色一区二区三区四区| 粉嫩蜜臀av国产精品网站| 国产欧美日韩不卡免费| 成人免费电影视频| 亚洲免费三区一区二区| 精品视频999| 奇米色一区二区三区四区| 精品国产免费一区二区三区四区 | 蜜臀av性久久久久蜜臀aⅴ| 欧美综合视频在线观看| 婷婷成人激情在线网| 日韩三级高清在线| 国产福利精品导航| 综合分类小说区另类春色亚洲小说欧美 | 国产精品91xxx| 欧美国产一区在线| 色av成人天堂桃色av| 男女男精品视频| 欧美激情在线免费观看| 91丨国产丨九色丨pron| 日韩国产一二三区| 国产欧美日韩精品a在线观看| 91片黄在线观看| 美国十次综合导航| 国产精品久久久久影院| 91精品国产综合久久精品图片| 国产美女精品人人做人人爽| 国产精品激情偷乱一区二区∴| 欧美体内she精视频| 久久99国产精品麻豆| 亚洲欧美日韩精品久久久久| 91精品国产一区二区人妖| 国产91在线观看| 人禽交欧美网站| 亚洲欧美日韩系列| 精品国产91洋老外米糕| 欧美自拍偷拍午夜视频| 国产成人丝袜美腿| 青青草一区二区三区| **欧美大码日韩| 精品国产第一区二区三区观看体验| av电影一区二区| 韩国女主播成人在线| 亚洲一区二区视频在线观看| 国产日韩欧美制服另类| 欧美一区二区三区影视| 欧美中文一区二区三区| 成人h动漫精品一区二区| 日本不卡一区二区三区| 一区二区在线观看视频在线观看| 久久久无码精品亚洲日韩按摩| 欧美日本在线视频| 日本电影亚洲天堂一区| 成人sese在线| 国产·精品毛片| 国产精品亚洲一区二区三区妖精 | 久久久久久久久久久久电影| 在线观看日韩av先锋影音电影院| 国产精品一区不卡| 精品一区二区免费看| 秋霞国产午夜精品免费视频| 国产成人一区在线| 国产精品一区二区免费不卡| 狠狠色丁香久久婷婷综合丁香| 日本午夜精品视频在线观看 | 精品美女在线播放| 日韩欧美一二区| 日韩精品在线一区| 精品成人免费观看| 欧美电视剧在线观看完整版| 欧美一区2区视频在线观看| 欧美欧美欧美欧美首页| 欧美日韩国产一级片| 欧美日韩国产在线观看| 7777精品伊人久久久大香线蕉超级流畅| 欧美性视频一区二区三区| 在线一区二区三区四区五区 | 偷窥国产亚洲免费视频| 亚洲午夜精品网| 婷婷成人激情在线网| 久久国产日韩欧美精品| 国产一区二区三区综合| 成人午夜短视频| 91亚洲精品一区二区乱码| 欧美在线free| 欧美一区二区三区喷汁尤物| 日韩一区二区在线观看视频播放| 日韩欧美国产系列| 国产欧美精品一区| 亚洲精品国产无天堂网2021| 婷婷成人激情在线网| 国产一区在线看| a4yy欧美一区二区三区| 欧美视频日韩视频| 精品国产一区二区三区久久久蜜月| 久久综合色天天久久综合图片| 国产免费观看久久| 一区二区三区在线免费视频| 偷窥少妇高潮呻吟av久久免费| 国产在线看一区| 色悠悠久久综合| 欧美一区二区三区日韩| 中文字幕一区二区三区乱码在线| 亚洲国产日韩a在线播放性色| 日本不卡视频在线| 国产99久久精品| 欧美精品色一区二区三区| 国产色婷婷亚洲99精品小说| 亚洲综合激情另类小说区| 精品一区精品二区高清| 色悠悠久久综合| 久久蜜臀中文字幕| 亚洲一区在线观看网站| 国产jizzjizz一区二区| 欧美精品久久99| 蜜桃免费网站一区二区三区|