http://msdn.microsoft.com/en-us/library/ms715441.aspx 写道
There are two exceptions to these restrictions and a driver's ability to relax them.
First, SQLGetData should never be called for a forward-only cursor when the rowset size is greater than 1.
Second, if a driver supports bookmarks, it must always support the ability to call SQLGetData for column 0, even if it does not allow applications to call SQLGetData for other columns before the last bound column. (When an application is working with an ODBC 2.x driver, SQLGetData will successfully return a bookmark when called with Col_or_Param_Num equal to 0 after a call to SQLFetch, because SQLFetch is mapped by the ODBC 3.x Driver Manager to SQLExtendedFetch with a FetchOrientation of SQL_FETCH_NEXT, and SQLGetData with a Col_or_Param_Num of 0 is mapped by the ODBC 3.x Driver Manager to SQLGetStmtOption with an fOption of SQL_GET_BOOKMARK.)
First, SQLGetData should never be called for a forward-only cursor when the rowset size is greater than 1.
Second, if a driver supports bookmarks, it must always support the ability to call SQLGetData for column 0, even if it does not allow applications to call SQLGetData for other columns before the last bound column. (When an application is working with an ODBC 2.x driver, SQLGetData will successfully return a bookmark when called with Col_or_Param_Num equal to 0 after a call to SQLFetch, because SQLFetch is mapped by the ODBC 3.x Driver Manager to SQLExtendedFetch with a FetchOrientation of SQL_FETCH_NEXT, and SQLGetData with a Col_or_Param_Num of 0 is mapped by the ODBC 3.x Driver Manager to SQLGetStmtOption with an fOption of SQL_GET_BOOKMARK.)
非常值得注意的 第一点:游标为block cursor类型时,决不要去调用SQLGetData.
而且在这种类型的游标时,SQLSetPos也是不可用的
本文探讨了在ODBC编程环境下使用SQLGetData函数时的两个主要限制:一是当游标为前进只读且行集大小大于1时,不应调用SQLGetData;二是对于支持书签的驱动程序,即使不允许可编程应用在最后一个绑定列前调用SQLGetData获取其他列数据,也必须允许调用SQLGetData获取第0列(即书签)。此外还提到,在block cursor类型下游标时,不应调用SQLGetData和SQLSetPos。
2640

被折叠的 条评论
为什么被折叠?



