我在Windows98计算机上使用我的代码访问从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中不能工作的东西,但也许我看得还不够努力。如有任何提示或帮助,将不胜感激!
发布于 2014-11-14 13:22:57
这似乎是一个已知的问题,并且已经在SQLITE论坛中进行了讨论。
原因是“读写文件时重叠”的变化。根据SQLITE,他们不建议在旧版本的windows上使用它。如果你真的必须使用它,那就更喜欢旧版本。
通过这个链接,他们提出了一种让sqlite在windows98上运行的替代方案。
http://sqlite.1065341.n5.nabble.com/Running-on-windows-98-td66471.html
https://stackoverflow.com/questions/17218857
复制相似问题