easySQLite使用笔记
由于在开发酷Q机器人时需要用到SQLite,所以找到了easySQLite,这是一个简单的SQLite封装库,使用起来比较方便,但是文档不够详细,所以在这里做一些补充
easySQLite地址:https://code.google.com/archive/p/easysqlite/
由于需要用到SQLite,经过一番兜兜转转,看到了easySQLite,下载下来,还不错,就是有些地方说明不够详细,以此做补充
打开数据库
使用时提示 “Database::open: unable to open database file”,可能是因为fileName编码不正确,因为此处要求ut8编码,尝试在前头加上 u8,例如:db.open(u8"D:/中文文件夹名/test.db");, 或对fileName进行转码
1 | //gbk转UTF-8 |
取字段值
1 | //load all records |