调用 SQLSetPos 以插入数据Calling SQLSetPos to Insert Data

使用 odbc 1.x 驱动程序的 odbc 1.x 应用程序 使用 SQL_ADD 的 操作 参数调用 SQLSetPos 时,驱动程序管理器不会将此调用映射到 SQLBulkOperationsWhen an ODBC 2.x application working with an ODBC 3.x driver calls SQLSetPos with an Operation argument of SQL_ADD, the Driver Manager does not map this call to SQLBulkOperations. 如果 ODBC 1.x 驱动程序应 与使用 SQL_ADD 调用 SQLSetPos 的应用程序配合使用,则驱动程序应支持该操作。If an ODBC 3.x driver should work with an application that calls SQLSetPos with SQL_ADD, the driver should support that operation.

当调用 SQLSetPos 时,行为的主要区别是在状态 S6 中调用时出现 SQL_ADD。One major difference in behavior when SQLSetPos is called with SQL_ADD occurs when it is called in state S6. 在 ODBC 2.x 中, 当调用 SQLSetPos 时,驱动程序将返回 S1010,SQL_ADD 并在将游标定位到 SQLFetch) 之后,在状态 S6 (中调用。In ODBC 2.x, the driver returned S1010 when SQLSetPos was called with SQL_ADD in state S6 (after the cursor has been positioned with SQLFetch). 在 ODBC 3.x 中, SQLBulkOperations 操作 SQL_ADD 的可以在 S6 状态下调用。In ODBC 3.x, SQLBulkOperations with an Operation of SQL_ADD can be called in state S6. 行为的另一个主要差别在于, SQLBulkOperations 操作 SQL_ADD 的 操作 可以在中调用,而 SQLSetPos 的 SQL_ADD 操作 不能。A second major difference in behavior is that SQLBulkOperations with an Operation of SQL_ADD can be called in state S5, while SQLSetPos with an Operation of SQL_ADD cannot. 对于 ODBC 1.x 中相同调用可能发生的语句转换 ,请参阅附录 B: ODBC 状态转换表For the statement transitions that can occur for the same call in ODBC 3.x, see Appendix B: ODBC State Transition Tables.