勇芳软件工作室.汉化:  SQLite3 API Functions > Statements >

sqlite3_db_handle

Previous pageReturn to chapter overviewNext page

描述

 

sqlite3_db_handle函数返回准备语句所属的数据库连接句柄。由sqlite3_db_handle返回的数据库连接是与用于首先创建语句的sqlite3_prepare_v2调用(或其变体)的第一个参数相同的数据库连接。

 

C / C ++语法

 

sqlite3 *sqlite3_db_handle(sqlite3_stmt*);

 

PB语法

 

FUNCTION sqlite3_db_handle ( _

BYVAL hStmt AS DWORD _

) AS DWORD

 

参数

 

pStmt

 

[in]语句句柄。

 

返回值

 

准备语句所属的数据库连接句柄。

 

C ++实现代码

 

/*

** Return the sqlite3* database handle to which the prepared statement given

** in the argument belongs.  This is the same database handle that was

** the first argument to the sqlite3_prepare() that was used to create

** the statement in the first place.

*/

SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){

return pStmt ? ((Vdbe*)pStmt)->db : 0;

}