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

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

?? odbc-e3.htm

?? odbc教程真的很不錯
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<html>
<head>
<title>ODBC Programming Tutorial: Preparing and Using Statements</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000000" text="#FFFFFF" link="#FFFFCC" vlink="#FFCCCC" alink="#CCFFCC">
<h1 align="center"><font face="Tahoma" color="#FFFFCC">Preparing and Using Statements</font></h1>
<p><font face="Tahoma" size="-1">In this tutorial, we will further our study of 
  ODBC programming. Specifically, we will learn how to interact with the data 
  source via ODBC.</font></p>
<p><font face="Tahoma" size="-1">In the previous tutorial, you know how to make 
  a connection to a data source. It's the first step. A connection defines a data 
  path between you and the data source. It's passive. In order to interact with 
  the data source, you need to use statement. You can think of a statement as 
  a command you send to a data source. The &quot;command&quot; must be written 
  in SQL. With statement, you can modify the structure of the data source, query 
  it for data, update data and delete data.</font></p>
<p><font face="Tahoma" size="-1">The steps in preparing and using statement are 
  as follows:</font></p>
<ol>
  <li><font face="Tahoma" size="-1">Allocate a statement handle</font></li>
  <li><font face="Tahoma" size="-1">Create the SQL statement</font></li>
  <li><font face="Tahoma" size="-1">Execute the statement</font></li>
  <li><font face="Tahoma" size="-1">Destroy the statement</font></li>
</ol>
<h4><font face="Tahoma" color="#FFFFCC">Allocate a statement handle</font></h4>
<p><font face="Tahoma" size="-1">You allocate a statement handle by calling<font color="#FFFFCC"><b> 
  SQLAllocHandle</b></font>, passing it the appropriate arguments. For example,</font></p>
<p><font face="Tahoma" size="-1"><b><font color="#33CCCC">.data?<br>
  hStmt dd ?</font></b></font></p>
<p><font face="Tahoma" size="-1" color="#33CCCC"><b>.code<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;......<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invoke SQLAllocHandle, SQL_HANDLE_STMT, hConn, 
  addr hStmt</b></font></p>
<h4><font face="Tahoma" color="#FFFFCC">Create the SQL statement</font></h4>
<p><font face="Tahoma" size="-1">This part, you have to help yourself. You must 
  learn about SQL grammar. For example, if you want to create a table, you need 
  to understand <font color="#CCFFCC"><b>CREATE TABLE</b></font>. </font></p>
<h4><font face="Tahoma" color="#FFFFCC">Execute the statement</font></h4>
<p><font face="Tahoma" size="-1">There are four ways of executing a statement, 
  depending on when they are compiled (prepared) by the database engine and who 
  defines them.</font></p>
<table border="1" cellspacing="1" cellpadding="3" align="center">
  <tr> 
    <td bgcolor="#000099"><b><font face="Tahoma" size="-1">Direct Execution</font></b></td>
    <td bgcolor="#003333"><font face="Tahoma" size="-1">Your program defines the 
      SQL statement. The statement is compiled and executed at runtime in one 
      step.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#000099"><b><font face="Tahoma" size="-1">Prepared Execution</font></b></td>
    <td bgcolor="#003333"><font face="Tahoma" size="-1">Your program also defines 
      the SQL statement. However, the preparation and execution are divided into 
      two steps: first the SQL statement is prepared (compiled) and then it is 
      executed. With this method, you can compile the SQL statement once and then 
      execute the same SQL statement multiple times. It saves time.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#000099"><b><font face="Tahoma" size="-1">Procedures</font></b></td>
    <td bgcolor="#003333"><font face="Tahoma" size="-1">The SQL statements are 
      compiled and stored at the data source. Your program calls those statements 
      at run time.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#000099"><font face="Tahoma" size="-1"><b>Catalog</b></font></td>
    <td bgcolor="#003333"><font face="Tahoma" size="-1">The SQL statements are 
      hardcoded into the ODBC driver. The purpose of catalog functions is to return 
      predefined result sets such as the names of the tables in the database. 
      All in all, catalog functions are used to obtain information about the data 
      source. Your program calls them at run time.</font></td>
  </tr>
</table>
<p><font face="Tahoma" size="-1">These four methods have their pros and cons. 
  Direct execution is good when you run a particular SQL statement only once. 
  If you need to run a particular statement several times in succession, you'd 
  better use prepared execution because the SQL statement will be compiled the 
  first time it runs. On subsequent runs, it will execute faster because the statement 
  is already compiled. Procedures are the best choices if you want speed. Because 
  the procedures are already compiled and stored at the data source, they run 
  fast. The downside is that not all data stores support procedures. Catalog is 
  for obtaining information about the structure of the data source.</font></p>
<p><font face="Tahoma" size="-1">In this tutorial, we will focus on direct execution 
  and prepared execution because they are done on our application's side. Writing 
  procedures (stored procedures) are DBMS-specific. We will make use of catalog 
  functions in the future.</font></p>
<h4><font face="Tahoma" color="#FFFFCC">Direct Execution</font></h4>
<p><font face="Tahoma" size="-1">To execute your SQL statement directly and instantly, 
  call SQLExecDirect which has the following syntax:</font></p>
<blockquote> 
  <pre><font face="Tahoma"><b><font color="#33CCCC">SQLExecDirect proto StatementHandle:DWORD,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pStatementText:DWORD,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;TextLength:DWORD</font></b></font></pre>
</blockquote>
<ul>
  <li><font color="#FFCCFF" face="Tahoma"><b><font size="-1">StatementHandle</font></b></font><font face="Tahoma" size="-1">. 
    The handle to the statement you want to use</font></li>
  <li><font color="#FFCCFF" face="Tahoma"><b><font size="-1">pStatementText</font></b></font><font face="Tahoma" size="-1">. 
    The pointer to the SQL string you want to execute</font></li>
  <li><font color="#FFCCFF" face="Tahoma"><b><font size="-1">TextLength</font></b></font><font face="Tahoma" size="-1">. 
    The length of the SQL string.</font></li>
</ul>
<p><font face="Tahoma" size="-1">The possible return values are:</font></p>
<table border="1" cellspacing="1" cellpadding="3" align="center">
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_SUCCESS</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">The operation is successful.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_SUCCESS_WITH_INFO</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">The operation is successful 
      and it may encounter a non-fatal error.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_ERROR</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">The operation failed</font></td>
  </tr>
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_INVALID_HANDLE</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">The statement handle you 
      gave to the function was invalid</font></td>
  </tr>
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_NEED_DATA</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">If the SQL statement included 
      one or more parameters and you failed to supply them before execution, you'll 
      get this return value. You then need to submit the parameters via <font color="#FFFFCC"><b>SQLParamData</b></font> 
      or <font color="#FFFFCC"><b>SQLPutData</b></font>.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_NO_DATA</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">If your SQL statement 
      doesn't return a result set, ie. it's just an action query, you get this 
      value so you know that the action completed successfully but no result set 
      is returned.</font></td>
  </tr>
  <tr> 
    <td bgcolor="#003399"><b><font face="Tahoma" size="-1">SQL_STILL_EXECUTING</font></b></td>
    <td bgcolor="#333300"><font face="Tahoma" size="-1">If you execute the statement 
      asynchronously, <font color="#FFFFCC"> <b>SQLExecDirect</b></font> returns 
      immediately with this value, indicating that the statement is being processed. 
      By default, ODBC drivers operate in synchronous mode which is good if you 
      use a multithreading OS. If you want to execute asynchronously, you can 
      set the statement attribute with <font color="#FFFFCC"><b>SQLSetStmtAttr</b></font>.</font></td>
  </tr>
</table>
<p><font face="Tahoma" size="-1"><b><font color="#33CCCC">Example:</font></b></font></p>
<p><font color="#33CCCC" face="Tahoma"><b><font size="-1">.data<br>
  SQLStmt db &quot;select * from Sales&quot;,0</font></b></font></p>
<p><font face="Tahoma" size="-1"><b><font color="#33CCCC">.data?<br>
  hStmt dd ?</font></b></font></p>
<p><font color="#33CCCC" face="Tahoma"><b><font size="-1">.code<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....<br>
  </font></b></font><font face="Tahoma" size="-1" color="#33CCCC"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invoke 
  SQLAllocHandle, SQL_HANDLE_STMT, hConn, addr hStmt</b></font><font face="Tahoma"><br>
  <font size="-1"><b><font color="#33CCCC">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.if 
  ax==SQL_SUCCESS || ax==SQL_SUCCESS_WITH_INFO </font></b></font><br>
  <font color="#33CCCC"><b><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invoke 
  SQLExecDirect, hStmt, addr SQLStmt, sizeof SQLStmt</font></b></font></font></p>
<h4><font face="Tahoma" color="#FFFFCC">Prepared Execution</font></h4>
<p><font face="Tahoma" size="-1">The process of executing an SQL statement is 
  divided into two distince phases. In the first phase, you must *prepare* the 
  statement by calling <font color="#FFFFCC"><b>SQLPrepare</b></font>. Next, you 
  call <font color="#FFFFCC"><b>SQLExecute</b></font> to actually run the statement. 
  With prepared execution, you can call <font color="#FFFFCC"><b>SQLExecute</b></font> 
  on the same SQL statement any number of times. Combined with using SQL parameters, 
  this method is very effective for running the same SQL statement over and over 
  again.</font></p>
<p><font face="Tahoma" size="-1"><b><font color="#FFFFCC">SQLPrepare</font></b> 
  takes the same three parameters as <font color="#FFFFCC"><b>SQLExecDirect</b></font> 
  so I won't show its definition here. <font color="#FFFFCC"><b>SQLExecute</b></font> 
  has the following syntax:</font></p>
<blockquote> 
  <pre><font face="Tahoma"><b><font color="#33CCCC">SQLExecute proto StatementHandle:DWORD</font></b></font></pre>
</blockquote>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
94-欧美-setu| 在线观看一区二区视频| 亚洲午夜一区二区| 久久在线免费观看| 在线中文字幕不卡| 国产一区二区三区国产| 偷拍一区二区三区| 亚洲视频精选在线| 精品久久久久久亚洲综合网| 欧美色手机在线观看| 国产成人av一区二区三区在线| 爽好久久久欧美精品| 亚洲欧美偷拍三级| 久久久777精品电影网影网| 在线综合视频播放| 色域天天综合网| 国产精品中文字幕一区二区三区| 亚洲一区二区视频在线| 国产精品久久久久久久久快鸭| 精品国产髙清在线看国产毛片| 欧美日韩午夜在线视频| 91看片淫黄大片一级在线观看| 国产成人自拍网| 狠狠色狠狠色综合系列| 日韩制服丝袜先锋影音| 亚洲自拍偷拍网站| 国产一区二区免费在线| 精品亚洲aⅴ乱码一区二区三区| 一个色在线综合| 国产精品电影一区二区| 国产亚洲成aⅴ人片在线观看| 91精品国产欧美日韩| 欧美色中文字幕| 色哟哟日韩精品| 色屁屁一区二区| www.亚洲色图| 99久久99久久精品免费观看| 黄色日韩网站视频| 国产精品影音先锋| 国产高清不卡一区| 国产不卡在线播放| 东方aⅴ免费观看久久av| 国产91精品在线观看| 国产aⅴ综合色| 成人激情综合网站| 97久久精品人人澡人人爽| 成人一区二区三区中文字幕| 成人午夜看片网址| 成人av小说网| 国产精品久久久久久妇女6080| 国产精品美女久久福利网站 | 欧美美女直播网站| 在线观看亚洲精品| 欧美日韩成人在线一区| 欧美成人精品福利| 国产欧美精品区一区二区三区| 国产亚洲欧美在线| 国产精品传媒视频| 亚洲精品国产a久久久久久| 一区二区三区日韩精品视频| 亚洲成人一二三| 久久狠狠亚洲综合| 国产成人a级片| 91精品福利视频| 91精品国产乱| 国产日韩欧美在线一区| 亚洲色大成网站www久久九九| 亚洲一区二区在线免费看| 蜜臀国产一区二区三区在线播放 | 国产在线观看一区二区| 国产成人午夜电影网| 在线欧美日韩国产| 欧美tk—视频vk| 中文字幕一区免费在线观看| 亚洲成a人片在线观看中文| 久久国产综合精品| 不卡欧美aaaaa| 欧美男同性恋视频网站| 精品99一区二区三区| 国产精品短视频| 日韩二区三区四区| 国产成人av电影在线| 色播五月激情综合网| 日韩午夜av一区| 中文字幕一区二区三区av| 午夜精品福利一区二区蜜股av| 国产高清精品网站| 欧美乱妇15p| 国产综合色视频| 色综合久久久久综合99| 精品国产免费一区二区三区香蕉| 亚洲人精品午夜| 国产麻豆日韩欧美久久| 欧美色涩在线第一页| 国产偷国产偷精品高清尤物| 亚洲电影欧美电影有声小说| 国产成人av电影在线| 欧美一区二区三区四区高清| 国产精品污www在线观看| 日韩电影免费在线观看网站| 91亚洲精品久久久蜜桃| 久久久久久亚洲综合| 午夜精品一区在线观看| 99视频精品免费视频| 精品sm在线观看| 水野朝阳av一区二区三区| 91网站最新网址| 国产视频视频一区| 日本少妇一区二区| 在线观看免费亚洲| 中文字幕欧美激情一区| 国内一区二区视频| 欧美区在线观看| 亚洲一区二区三区中文字幕在线| 岛国精品一区二区| 久久丝袜美腿综合| 精品一区二区免费看| 91麻豆精品国产91久久久使用方法 | 欧美三级视频在线观看| 国产精品久久久久一区二区三区| 久久精品国产免费| 6080yy午夜一二三区久久| 亚洲一区中文在线| 91在线看国产| 国产精品美女久久久久av爽李琼| 国产在线精品免费| 精品美女被调教视频大全网站| 亚欧色一区w666天堂| 欧美日韩国产小视频| 一区二区高清视频在线观看| 91啪九色porn原创视频在线观看| 久久久久久久国产精品影院| 国内精品久久久久影院薰衣草| 日韩视频免费直播| 美女免费视频一区二区| 日韩欧美卡一卡二| 麻豆国产一区二区| 欧美精品一区二区在线观看| 国产乱妇无码大片在线观看| 久久精品亚洲乱码伦伦中文| 国产成人免费在线视频| 国产三级精品三级| 国产成人无遮挡在线视频| 国产精品欧美综合在线| 成人中文字幕合集| 中文字幕一区二区不卡| 91国产丝袜在线播放| 香蕉成人啪国产精品视频综合网| 777a∨成人精品桃花网| 蜜桃视频在线一区| 久久久精品中文字幕麻豆发布| 国产福利一区二区三区| 精品一区二区三区免费观看 | 国产老妇另类xxxxx| 国产欧美日韩激情| 99久久er热在这里只有精品66| 亚洲色图.com| 欧美精品在欧美一区二区少妇| 久久精品国产99国产| 中文字幕精品在线不卡| jvid福利写真一区二区三区| 亚洲国产综合人成综合网站| 欧美丰满少妇xxxxx高潮对白 | 欧美性生活久久| 免费观看一级欧美片| 日本一二三四高清不卡| 色香蕉久久蜜桃| 日韩av一区二| 欧美国产乱子伦| 欧美性做爰猛烈叫床潮| 免费观看一级欧美片| 国产精品不卡在线| 欧美美女网站色| 丰满少妇在线播放bd日韩电影| 怡红院av一区二区三区| 日韩亚洲欧美中文三级| 国产成人免费在线观看不卡| 亚洲与欧洲av电影| 国产午夜精品一区二区三区视频 | 国产成人免费av在线| 亚洲色图制服诱惑| 精品国产自在久精品国产| 不卡的电影网站| 日本欧美一区二区三区乱码| 中文字幕在线播放不卡一区| 日韩欧美亚洲国产另类| 99久久777色| 国产主播一区二区三区| 亚洲午夜成aⅴ人片| 国产拍欧美日韩视频二区| 欧美日韩国产影片| 成人av影院在线| 精品一区二区三区在线观看| 亚洲激情六月丁香| 国产欧美在线观看一区| 日韩一二三区视频| 欧美日韩综合在线免费观看| 成人激情av网| 国产成人亚洲综合a∨猫咪| 男人的天堂亚洲一区|