• 1.摘要
  • 2.基本信息
  • 3.介绍
  • 4.函数原型
  • 5.参数说明
  • 6.返回值
  • 7.说明

sqlite3_open

sqlite3_open是sqlite数据库的api函数(C/C++),作用是打开(或创建)一个数据库文件。

基本信息

  • 中文名

    sqlite3_open

  • 定义

    数据库的api函数(C/C++)

  • 函数原型

    int sqlite3_open

  • 参数说明

    待打开(创建)的数据库文件名

  • 返回值

    Sqlite3函数调用返回值列表

介绍

sqlite3_open是sqlite数据库的api函数(C/C++),作用是打开(或创建)一个数据库文件。

函数原型

int sqlite3_open(const char *filename, /* Database filename (UTF-8) */

sqlite3 **ppDb /* OUT: SQLite db handle */

);

参数说明

filename:待打开(创建)的数据库文件名

ppDb:sqlite3数据库句柄的指针

返回值

Sqlite3函数调用返回值列表

#define SQLITE_OK 0 /* Successful result */

/* beginning-of-error-codes */

#define SQLITE_ERROR 1 /* SQL error or missing database */

#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */

#define SQLITE_PERM 3 /* Access permission denied */

#define SQLITE_ABORT 4 /* Callback routine requested an abort */

#define SQLITE_BUSY 5 /* The database file is locked */

#define SQLITE_LOCKED 6 /* A table in the database is locked */