我在使用我的代码访问从 Windows 98 计算机上的 sqlite 创建的数据库时遇到问题。在输出错误消息时,我收到磁盘 I/O 错误。我正在使用 sqlite 版本 3.6.23 来创建数据库。这是我调用 sqlite3 以访问数据库的代码部分:
int sqlite3_extended_result_codes(sqlite3*, int on);
int result = sqlite3_open_v2(sqliteDatabasePath, &database, SQLITE_OPEN_READONLY, NULL);
if(result != SQLITE_OK)
{
cout << "Error opening database file: " << sqliteDatabasePath
<< endl << "Sqlite3 Error Code: " << result
<< endl;
cout << sqlite3_extended_errcode(database) << endl;
throw;
}
cout << "Successfully opened database " << sqliteDatabasePath << endl;
我还没有找到任何可以告诉我为什么这在 Win98 中不起作用的信息,但也许我看起来还不够努力。任何提示或帮助将不胜感激!
最佳答案
这似乎是一个已知问题,并且已经在 SQLITE 论坛中进行了讨论。
原因是“读写文件时重叠”发生了变化。根据 SQLITE,他们不建议在旧版本的 Windows 上使用它。如果您真的必须使用它,请选择旧版本。
通过这个链接,他们提出了一个让 sqlite 在 windows 98 上工作的替代方案。
http://sqlite.1065341.n5.nabble.com/Running-on-windows-98-td66471.html
关于c++ - SQLite 无法在 Win98 中打开数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17218857/