则用来得到这些错误代码所对应的文字说明. 这些错误信息将以 UTF-8 的编码返回,并且在下一次调用任何SQLite API函数的时候被清除. sqlite3_errmsg16() 和 sqlite3_errmsg() 大体上相同,除了返回的错误信息将以 UTF-16 本机字节顺序编码.
SQLite3的错误代码相比SQLite2没有任何的改变,它们分别是:
#define SQLITE_OK 0 /* Successful result */
#define SQLITE_ERROR 1 /* SQL error or missing database */
#define SQLITE_INTERNAL 2 /* An 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 */
#define SQLITE_NOMEM 7 /* A malloc() failed */
#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite_interrupt() */
#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
#define SQLITE_NOTFOUND 12 /* (Internal Only) Table or record not found */
#define SQLITE_FULL 13 /* Insertion failed because database is full */
#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
#define SQLITE_PROTOCOL 15 /* Database lock protocol error */
#define SQLITE_EMPTY 16 /* (Internal Only) Database table is empty */
#define SQLITE_SCHEMA 17 /* The database schema changed */
#define SQLITE_TOOBIG 18 /* Too much data for one row of a table */
#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */
#define SQLITE_MISMATCH 20 /* Data type mismatch */
#define SQLITE_MISUSE 21 /* Library used incorrectly */
#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
#define SQLITE_AUTH 23 /* Authorization denied */
#define SQLITE_ROW 100 /* sqlite_step() has another row ready */
#define SQLITE_DONE 101 /* sqlite_step() has finished executing */
2.2 执行 SQL 语句
typedef int (*sqlite_callback)(void*,int,char**, char**);
int sqlite3_exec(sqlite3*, const char *sql, sqlite_callback, void*, char**);
sqlite3_exec 函数依然像它在SQLite2中一样承担着很多的工作. 该函数的第二个参数中可以编译和执行零个或多个SQL语句. 查询的结果返回给回调函数. 更多地信息可以查看API 参考.
在SQLite3里,sqlite3_exec一般是被准备SQL语句接口封装起来使用的.
typedef struct sqlite3_stmt sqlite3_stmt;
int sqlite3_prepare(sqlite3*, const char*, int, sqlite3_stmt**, const char**);
int sqlite3_prepare16(sqlite3*, const void*, int, sqlite3_stmt**, const void**);
int sqlite3_finalize(sqlite3_stmt*);
SQLite 开发入门使用之前请先下载sqlite3.exe文件,不用安装,直接放到F盘创建的sqlite3的文件夹下面。 下载地址:http://www.sqlite.org/download.html 1) 运行"...
暂无评价0人阅读0次下载举报文档 SQLite3 CC++ 开发接口简介(API函数)_计算机软件及应用_IT/计算机_专业资料。SQLite3 CC++ 开发接口简介(API函数)...
暂无评价0人阅读0次下载举报文档 SQLite开发入门手册_计算机软件及应用_IT/计算机_专业资料。SQLite开发入门手册,安装部署,sqlite相关操作和相关概念,以及若干...
暂无评价0人阅读0次下载举报文档 Android NDK 开发及Sqlite3 加密技术_计算机软件及应用_IT/计算机_专业资料。张伟伟 2012/07/12 Android NDK开发 ? 什么...
SQLite3 API使用大全_IT/计算机_专业资料。SQLite3是一个让人喜不自胜的小型轻量级数据库,一个sqlite3.dll,一个exe,一个db文件,你的复杂的数据库相关的应用...
使用VS2008 和 SQLite3.7.12 开发 WinCE5.0 下应用 1 VS2008 创建新工程启动 VS2008 后,点击【文件】 【新建项目】菜单, 在弹出“新建项目”窗口中选择 ...
暂无评价0人阅读0次下载举报文档 SQLite3_API使用详解_计算机软件及应用_IT/计算机_专业资料。SQLite3 API 使用大全 E-mail:18918737 (at) qq dot com,...
SQLite3 API编程手册_计算机软件及应用_IT/计算机_专业资料。sqlite数据库主要用于嵌入式平台,该文档详细描述了如何用c源代码控制对嵌入式系统中sqlite数据库的控制...
二. 软硬件平台: OS: 编译器: 开发板: Linux 内核: 交缠编译器: Sqlite: fedora7; gcc 版本 4.1.2 20070502 (Red Hat 4.1.2-12): 基于 Sep4020 的...
关联性数据库」 (进一步的概念可参考网络上各种关于 SQL 及关联性数据库的文件...SQLite3 C/C++ 开发接口简介 1.0 总览 SQLite3是 SQLite 一个全新的版本,它...
热门文档