已存在数据库时打开 出错
Posted: Fri Sep 01, 2017 12:56 pm
刚刚学习sqlite3 遇到这样的问题:
x64 debug编译正常 在运行时,第一次无问题,第二次也就是test.db存在时 就会出错
unhandled exception An unhandled exception occurred. 试着删除test.db,重新运行,又正常了,关键是我现在想学会后,在程序中打开我已建好的database ,请问,这个问题出在什么地方?
Code: Select all
const wxString dbFile = wxGetCwd() + "/test.db";
m_textctrl->AppendText(dbFile);
wxSQLite3Database db;
if (wxSQLite3Database::HasEncryptionSupport())
{
db.Open(dbFile, wxString(wxT("password")));
m_textctrl->AppendText("open db with password\n");
}
else
{
db.Open(dbFile);
m_textctrl->AppendText("open db without password\n");
}
unhandled exception An unhandled exception occurred. 试着删除test.db,重新运行,又正常了,关键是我现在想学会后,在程序中打开我已建好的database ,请问,这个问题出在什么地方?