青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

r2100

  C++博客 :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
  8 Posts :: 9 Stories :: 2 Comments :: 0 Trackbacks

常用鏈接

留言簿(3)

我參與的團(tuán)隊(duì)

搜索

  •  

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

SQLExecDirect函數(shù)源代碼
static SQLRETURN
ODBCExecDirect(ODBCStmt 
*stmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStr)
{
    
char *query;
    MapiMsg ret;
    MapiHdl hdl;

    hdl 
= stmt->hdl;

    
if (stmt->State >= EXECUTED1 || (stmt->State == EXECUTED0 && mapi_more_results(hdl))) {
        
/* Invalid cursor state */
        addStmtError(stmt, 
"24000", NULL, 0);
        
return SQL_ERROR;
    }

    
/* TODO: convert ODBC escape sequences ( {d 'value'} or {t 'value'} or
       {ts 'value'} or {escape 'e-char'} or {oj outer-join} or
       {fn scalar-function} etc. ) to MonetDB SQL syntax 
*/
    query 
= ODBCTranslateSQL(szSqlStr, (size_t) nSqlStr, stmt->noScan);

    ODBCResetStmt(stmt);

#ifdef ODBCDEBUG
    ODBCLOG(
"SQLExecDirect: \"%s\"\n", query);
#endif

    ret 
= mapi_query_handle(hdl, query);
    free(query);
    
switch (ret) {
    
case MOK:
        
break;
    
case MTIMEOUT:
        
/* Communication link failure */
        addStmtError(stmt, 
"08S01", mapi_error_str(stmt->Dbc->mid), 0);
        
return SQL_ERROR;
    
default:
        
/* General error */
        addStmtError(stmt, 
"HY000", mapi_error_str(stmt->Dbc->mid), 0);
        
return SQL_ERROR;
    }

    
/* now get the result data and store it to our internal data structure */

    
return ODBCInitResult(stmt);
}

As mentioned earlier, it is more efficient to reuse statements than to drop them and allocate new ones. Before executing a new SQL statement on a statement, applications should be sure that the current statement settings are appropriate. These include statement attributes, parameter bindings, and result set bindings. Generally, parameters and result sets for the old SQL statement need to be unbound (by calling SQLFreeStmt with the SQL_RESET_PARAMS and SQL_UNBIND options) and rebound for the new SQL statement.

When the application has finished using the statement, it calls SQLFreeHandle to free the statement. After freeing the statement, it is an application programming error to use the statement's handle in a call to an ODBC function; doing so has undefined but probably fatal consequences.

When SQLFreeHandle is called, the driver releases the structure used to store information about the statement.

SQLDisconnect automatically frees all statements on a connection.


         
/**********************************************
 * ODBCStmt.c
 *
 * Description:
 * This file contains the functions which operate on
 * ODBC statement structures/objects (see ODBCStmt.h).
 *
 * Author: Martin van Dinther
 * Date  : 30 aug 2002
 *
 *********************************************
*/

#include 
"ODBCGlobal.h"
#include 
"ODBCStmt.h"

#define ODBC_STMT_MAGIC_NR  5461    /* for internal sanity check only */


/*
 * Creates a new allocated ODBCStmt object and initializes it.
 *
 * Precondition: none
 * Postcondition: returns a new ODBCStmt object
 
*/
ODBCStmt 
*
newODBCStmt(ODBCDbc 
*dbc)
{
    ODBCStmt 
*stmt = (ODBCStmt *) malloc(sizeof(ODBCStmt));
    assert(stmt);

    assert(dbc);
    assert(dbc
->mid);

    
if (stmt == NULL) {
        
/* Memory allocation error */
        addDbcError(dbc, 
"HY001", NULL, 0);
        
return NULL;
    }

    stmt
->Dbc = dbc;
    stmt
->Error = NULL;
    stmt
->RetrievedErrors = 0;

    stmt
->State = INITED;
    stmt
->hdl = mapi_new_handle(dbc->mid);
    
if (stmt->hdl == NULL) {
        
/* Memory allocation error */
        addDbcError(dbc, 
"HY001", NULL, 0);
        free(stmt);
        
return NULL;
    }
    assert(stmt
->hdl);

    stmt
->currentRow = 0;
    stmt
->startRow = 0;
    stmt
->rowSetSize = 0;
    stmt
->queryid = -1;
    stmt
->nparams = 0;
    stmt
->querytype = -1;
    stmt
->rowcount = 0;

    
/* add this stmt to the administrative linked stmt list */
    stmt
->next = dbc->FirstStmt;
    dbc
->FirstStmt = stmt;

    stmt
->cursorType = SQL_CURSOR_FORWARD_ONLY;
    stmt
->cursorScrollable = SQL_NONSCROLLABLE;
    stmt
->retrieveData = SQL_RD_ON;
    stmt
->noScan = SQL_NOSCAN_OFF;

    stmt
->ApplRowDescr = newODBCDesc(dbc);
    stmt
->ApplParamDescr = newODBCDesc(dbc);
    stmt
->ImplRowDescr = newODBCDesc(dbc);
    stmt
->ImplParamDescr = newODBCDesc(dbc);
    stmt
->AutoApplRowDescr = stmt->ApplRowDescr;
    stmt
->AutoApplParamDescr = stmt->ApplParamDescr;

    
if (stmt->ApplRowDescr == NULL || stmt->ApplParamDescr == NULL || stmt->ImplRowDescr == NULL || stmt->ImplParamDescr == NULL) {
        destroyODBCStmt(stmt);
        
return NULL;
    }

    stmt
->ApplRowDescr->sql_desc_alloc_type = SQL_DESC_ALLOC_AUTO;
    stmt
->ApplParamDescr->sql_desc_alloc_type = SQL_DESC_ALLOC_AUTO;
    stmt
->ImplRowDescr->sql_desc_alloc_type = SQL_DESC_ALLOC_AUTO;
    stmt
->ImplParamDescr->sql_desc_alloc_type = SQL_DESC_ALLOC_AUTO;
    stmt
->ImplRowDescr->Stmt = stmt;
    stmt
->ImplParamDescr->Stmt = stmt;

    stmt
->Type = ODBC_STMT_MAGIC_NR;    /* set it valid */

    
return stmt;
}

SQLFreeHandle
ODBCFreeStmt_(ODBCStmt 
*stmt)
{
    
/* check if statement is not active */
    
if (stmt->State >= EXECUTED0) {
        
/* should be closed first */
        
if (SQLFreeStmt_(stmt, SQL_CLOSE) == SQL_ERROR)
            
return SQL_ERROR;
    }

    
/* Ready to destroy the stmt handle */
    destroyODBCStmt(stmt);
    
return SQL_SUCCESS;
}


SQLFreeStmt

SQLFreeStmt_(ODBCStmt 
*stmt, SQLUSMALLINT option)
{
    
switch (option) {
    
case SQL_CLOSE:
        
/* Note: this option is also called from SQLCancel() and
           SQLCloseCursor(), so be careful when changing the code 
*/
        
/* close cursor, discard result set, set to prepared */
        setODBCDescRecCount(stmt
->ImplRowDescr, 0);
        stmt
->currentRow = 0;
        stmt
->startRow = 0;
        stmt
->rowSetSize = 0;

        
if (stmt->State == EXECUTED0)
            stmt
->State = stmt->queryid >= 0 ? PREPARED0 : INITED;
        
else if (stmt->State >= EXECUTED1)
            stmt
->State = stmt->queryid >= 0 ? PREPARED1 : INITED;

        
/* Important: do not destroy the bind parameters and columns! */
        
return SQL_SUCCESS;
    
case SQL_DROP:
        
return ODBCFreeStmt_(stmt);
    
case SQL_UNBIND:
        setODBCDescRecCount(stmt
->ApplRowDescr, 0);
        
return SQL_SUCCESS;
    
case SQL_RESET_PARAMS:
        setODBCDescRecCount(stmt
->ApplParamDescr, 0);
        setODBCDescRecCount(stmt
->ImplParamDescr, 0);
        mapi_clear_params(stmt
->hdl);
        
return SQL_SUCCESS;
    
default:
        
/* Invalid attribute/option identifier */
        addStmtError(stmt, 
"HY092", NULL, 0);
        
return SQL_ERROR;
    }

    
/* not reached */
}

SQLHSTMT的結(jié)構(gòu)
typedef 
struct tODBCDRIVERSTMT {
    
/* Stmt properties */
    
int Type;        /* structure type, used for handle validy test */
    ODBCError 
*Error;    /* pointer to an Error object or NULL */
    
int RetrievedErrors;    /* # of errors already retrieved by SQLError */
    ODBCDbc 
*Dbc;        /* Connection context */
    
struct tODBCDRIVERSTMT *next;    /* the linked list of stmt's in this Dbc */
    
enum StatementState State;    /* needed to detect invalid cursor state */
    MapiHdl hdl;

    unsigned 
int rowcount;    /* # affected rows */

    
/* startRow is the row number of first row in the result
       set (0 based); rowSetSize is the number of rows in the
       current result set; currentRow is the row number of the
       current row within the current result set 
*/
    unsigned 
int currentRow;
    unsigned 
int startRow;
    unsigned 
int rowSetSize;

    unsigned 
int currentCol; /* used by SQLGetData() */
    SQLINTEGER retrieved;    
/* amount of data retrieved */
    
int queryid;        /* the query to be executed */
    
int nparams;        /* the number of parameters expected */

    
int querytype;        /* query type as returned by server */

    SQLUINTEGER cursorType;
    SQLUINTEGER cursorScrollable;
    SQLUINTEGER retrieveData;
    SQLUINTEGER noScan;

    ODBCDesc 
*ApplRowDescr;    /* Application Row Descriptor (ARD) */
    ODBCDesc 
*ApplParamDescr; /* Application Parameter Descriptor (APD) */
    ODBCDesc 
*ImplRowDescr;    /* Implementation Row Descriptor (IRD) */
    ODBCDesc 
*ImplParamDescr; /* Implementation Parameter Descriptor (IPD) */

    ODBCDesc 
*AutoApplRowDescr; /* Auto-allocated ARD */
    ODBCDesc 
*AutoApplParamDescr; /* Auto-allocated APD */

    
/* Stmt children: none yet */
} ODBCStmt;






posted on 2008-09-11 11:31 r2100 閱讀(1170) 評(píng)論(2)  編輯 收藏 引用

Feedback

# re: http://msdn.microsoft.com/en-us/library/ms716303(VS.85).aspx 2008-09-11 11:32 r2100
但是一直沒(méi)有找到實(shí)例,郁悶  回復(fù)  更多評(píng)論
  

# re: http://msdn.microsoft.com/en-us/library/ms716303(VS.85).aspx 2009-01-28 18:01 張三
安裝不成。。。  回復(fù)  更多評(píng)論
  


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美在线免费观看| 国产精品老女人精品视频| 欧美大片在线看| 亚洲精品在线一区二区| 欧美精品日韩三级| 日韩亚洲不卡在线| 久久精品国产欧美激情| 亚洲福利一区| 国产精品成人播放| 欧美在线free| 樱桃成人精品视频在线播放| 欧美国产综合| 亚洲女爱视频在线| 欧美国产日韩视频| 亚洲欧美日韩国产精品| 在线成人av网站| 欧美日韩系列| 久久久久久久激情视频| 亚洲久久在线| 国产欧美视频一区二区| 麻豆乱码国产一区二区三区| 中文欧美字幕免费| 欧美高潮视频| 欧美在线视频免费观看| 亚洲美女啪啪| 国外成人在线视频| 欧美午夜精品久久久久久孕妇| 久久精品二区三区| 一区二区电影免费在线观看| 极品av少妇一区二区| 欧美日韩另类丝袜其他| 久久精品一区二区三区中文字幕| 日韩一区二区精品视频| 免费成人高清| 久久狠狠亚洲综合| 亚洲一区二区视频在线观看| 亚洲大片av| 国产一区二区精品| 国产精品久久久久毛片大屁完整版| 老色鬼久久亚洲一区二区| 亚洲欧美精品suv| 日韩视频在线观看国产| 尤物在线精品| 国内精品写真在线观看| 国产精品麻豆va在线播放| 欧美日韩八区| 欧美成人精品影院| 噜噜噜躁狠狠躁狠狠精品视频 | 蜜臀久久99精品久久久久久9 | 久久激情五月丁香伊人| 亚洲视屏一区| 99人久久精品视频最新地址| 亚洲激情影院| 欧美激情乱人伦| 欧美高清视频在线| 欧美+日本+国产+在线a∨观看| 国产乱码精品一区二区三| 欧美日韩国产精品自在自线| 欧美福利视频网站| 欧美.日韩.国产.一区.二区| 美乳少妇欧美精品| 狂野欧美激情性xxxx欧美| 久久亚洲精品一区| 久久男人资源视频| 久久综合精品国产一区二区三区| 久久蜜桃资源一区二区老牛| 久久久久国内| 久久精品官网| 久久香蕉精品| 欧美www在线| 欧美国产视频一区二区| 欧美国产一区二区| 亚洲国产精品久久人人爱蜜臀 | 亚洲另类一区二区| 日韩视频一区二区三区在线播放| 亚洲免费av观看| 一区二区三区国产在线| 亚洲影视中文字幕| 国产日韩在线一区二区三区| 国产精品午夜春色av| 国产精品视频导航| 国产一区二区日韩| 亚洲风情亚aⅴ在线发布| 亚洲国产一区视频| 亚洲一区二区三区免费在线观看| 亚洲一区二区在线观看视频| 米奇777超碰欧美日韩亚洲| 国产精品欧美久久| 亚洲美女在线看| 开心色5月久久精品| 亚洲无线观看| 欧美精品一区二区精品网| 国语对白精品一区二区| 亚洲欧美偷拍卡通变态| 亚洲日本中文字幕| 久久免费观看视频| 性做久久久久久久久| 欧美日本一道本在线视频| 伊人久久综合| 久久久亚洲成人| 亚洲综合色噜噜狠狠| 欧美日韩综合视频| 亚洲精品一区二区三区av| 久久综合给合| 欧美一级欧美一级在线播放| 国产精品久久久久婷婷| 宅男噜噜噜66国产日韩在线观看| 欧美国产精品一区| 久久综合网络一区二区| 亚洲欧美激情精品一区二区| 欧美视频第二页| 一区二区欧美精品| 亚洲黄色av一区| 你懂的网址国产 欧美| 亚洲国产成人高清精品| 裸体丰满少妇做受久久99精品| 午夜日韩福利| 国产偷国产偷精品高清尤物| 欧美一区二区大片| 亚洲在线第一页| 国产精品自拍一区| 欧美一区日本一区韩国一区| 亚洲欧美日韩精品在线| 国产精品麻豆欧美日韩ww | 久久视频在线看| 黄色成人在线| 暖暖成人免费视频| 久久九九久精品国产免费直播| 国产亚洲免费的视频看| 久久人人97超碰国产公开结果| 欧美一区二区私人影院日本 | 欧美电影免费观看大全| 亚洲精品黄网在线观看| 亚洲高清资源| 欧美久久在线| 亚洲欧美日韩精品一区二区| 亚洲综合精品四区| 国产日韩一区二区三区在线| 久久久久欧美| 久热爱精品视频线路一| 亚洲精品婷婷| 一区二区日本视频| 国产乱码精品一区二区三区五月婷 | 欧美在线视频观看免费网站| 狠狠综合久久av一区二区老牛| 美女免费视频一区| 欧美风情在线| 亚洲永久在线| 久久av一区二区三区漫画| 美女精品在线观看| 亚洲精品国产精品久久清纯直播 | 国产麻豆9l精品三级站| 久久频这里精品99香蕉| 榴莲视频成人在线观看| 日韩一区二区精品视频| 亚洲图片欧洲图片av| 国内精品久久国产| 亚洲国产日韩欧美在线图片| 欧美性理论片在线观看片免费| 欧美在线日韩精品| 免费成人性网站| 国产精品va在线播放| 久久国产婷婷国产香蕉| 美女日韩欧美| 午夜精品久久久久久久男人的天堂| 久久精品国产v日韩v亚洲| 99香蕉国产精品偷在线观看| 亚洲女优在线| 亚洲精品国产品国语在线app| 亚洲一线二线三线久久久| 在线播放视频一区| 中日韩美女免费视频网站在线观看| 国产一区二区三区四区| 亚洲精品三级| 一区二区亚洲精品| 制服丝袜亚洲播放| 久久国产精品高清| 这里只有视频精品| 久久久久久夜精品精品免费| 亚洲图片在线| 老**午夜毛片一区二区三区| 先锋a资源在线看亚洲| 欧美91视频| 久久久视频精品| 国产精品高清一区二区三区| 欧美黄色免费网站| 国产一区二区丝袜高跟鞋图片| 日韩图片一区| 亚洲激情在线观看| 欧美一区激情| 欧美午夜精品理论片a级大开眼界| 免费91麻豆精品国产自产在线观看| 欧美小视频在线| 亚洲欧洲一区二区在线播放| 国语自产精品视频在线看一大j8| 亚洲视频在线播放| 一区二区三区国产在线观看| 免播放器亚洲| 免费欧美日韩| 狠狠色噜噜狠狠色综合久|