当前位置:首页 > 数据库 > SQlite

C++用sqlite3_open连接打开指定数据库的小问题

stdafx.h" #include "sqlite3.h" #include <iostream> using namespace std; sqlite3 * pDB = NULL; int _tmain(int argc, _TCHAR* argv[]) { //打开路径采用utf-8编码 //如果路径中包含中文,需要进行编码转换
  //指定数据库路径记得写全 并加上 分号 " ; "
int nRes = sqlite3_open("D:\sqlite\fuck.db;", &pDB); if (nRes != SQLITE_OK) { cout << "Open database fail: " << sqlite3_errmsg(pDB); goto QUIT; } else { cout << "打开数据库成功!" << endl; } QUIT: sqlite3_close(pDB); return 0; }

 

C++用sqlite3_open连接打开指定数据库的小问题

标签:c++   cout   style   ret   sqlite   fail   rms   pre   lse   

本文系统来源:https://www.cnblogs.com/maoye520/p/11223844.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!