1. 程式人生 > >ODBCAPI常用函式詮釋

ODBCAPI常用函式詮釋

<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
ODBC API常用函式詮釋
記得kony曾經在我的這個罈子上轉過一個帖子,解釋使用ODBC資料來源來連線進行資料庫操作速度慢的原因,同時那個帖子也提出了提高ODBC資料來源連線資料庫進行資料庫操作速度的兩個辦法,一個是利用VisiualBasic中的RDO元件,一個就是直接呼叫ODBCAPI函式進行相關資料庫操作,應答應過這裡的弟弟妹妹們寫點關於ODBCAPI函式方面的東東,所以只能趕鴨子上架了;
      以下為ODBCAPI的常用十四個函式,先列出在中外部函式引用宣告:
    functionintegerSQLAllocEnv(reflongphenv)library"odbc32.dll"
    functionintegerSQLFreeEnv(longhenv)library"odbc32.dll"
    functionintegerSQLDataSources(longhenv,intfdirection,refstringszdsn,&
integercbdsnmax,refintegerpcbdsn,refstringszdescription,integercbdescriptionmax,refintegerpcbdescription)library"odbc32.dll"
    functionintegerSQLAllocConnect(longhenv,reflonghdbc)library"odbc32.dll"
    functionintegerSQLConnect(longhstmt,refstringszdsn,integerdsnlen,refstring
szuid,integeruidlen,refstringszpwd,integerpwdlen)library"odbc32.dll"
    functionintegerSQLDisconnect(longhdbc)library"odbc32.dll"
    functionintegerSQLAllocStmt(longhdbc,reflonghstmt)library"odbc32.dll"
    functionintegerSQLTables(longhstmt,refstringsztablequalifier,integertablequalifierlen,refstringszowner,integerowerlen,refstringszname,integernamelen,
refstringsztype,integertypelen)library"odbc32.dll"
    functionintegerSQLColumns(longhstmt,refstringsztablequalifier,integertablequalifierlen,refstringszowner,integerowerlen,refstringszname,integernamelen,
refstringsztype,integertypelen)library"odbc32.dll"
    functionintegerSQLBindCol(longhstmt,integercolnum,integerdatatype,refstringname,longmaxlen,reflongactlen)library"odbc32.dll"
    functionintegerSQLFetch(longhstmt)library"odbc32.dll"
    functionintegerSQLError(longlenv,longhdbc,longhstmt,refstringsqlstate,reflongnativeerror,refstringerrormsg,integererrormsgmax,refintegererrormsglen)library"odbc32.dll"
    functionintegerSQLFreeStmt(longhstmt,integerOptions)library"odbc32.dll"
1、functionintegerSQLAllocEnv(reflongphenv)library"odbc32.dll"
    引數:reflongphenv引用傳遞的long型別引數,儲存該函式返回的OBDC環境的控制代碼。
  存放在phenv中的值成為以後OBDCAPI函式呼叫的唯一識別符號。
  返回值:integer成功時,返回0,失敗返回值小於0。
  函式功能:獲取ODBC環境控制代碼。
2、functionintegerSQLAllocStmt(longhdbc,reflonghstmt)library"odbc32.dll"
    引數:longhdbcODBC環境的控制代碼。
        Reflonghstmt儲存SQL語句控制代碼。
  返回值:integer,成功時,返回0,失敗返回值小於0。
  函式功能:獲取SQL語句控制代碼。共5頁  第1頁    
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>