更新完成后关闭ado访问连接,并删除mdb文件
我试图在读完 mdb 文件后删除它。
过程是:
copyFile(originMdb, to targetMdb);
mdbConnection.active := true;
mdbQuery.open;
readMdbFileData;
mdbQuery.close;
connection.close;
deleteFile(tagetMdb);
但是有一个生成的ldb文件不会消失。
更新: 有没有办法告诉mdb,“我现在不需要更多连接,关闭它,并删除ldb文件上的锁” 相反,mdb 引擎正在等待进程结束,然后才会释放使用 adoConnection update2 建立的连接
:创建一个刚刚打开和关闭连接的简单程序后,文件被释放,但是由于我持有 adoqury,它拒绝释放文件。
I'm trying to delete the mdb file after finished reading it.
The process is:
copyFile(originMdb, to targetMdb);
mdbConnection.active := true;
mdbQuery.open;
readMdbFileData;
mdbQuery.close;
connection.close;
deleteFile(tagetMdb);
But there is an ldb file that is generated that will not disappear.
update:
is there a way to tell the mdb, "i don't need any more connections now, close it, and remove the locks on the ldb file"
instead the mdb engine is waiting for the process to end before it will release the connection that was made with adoConnection
update2: after creating a simple program that just opened and closed connection, the file is released, however since i hold an adoqury it refuses to releasea the file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要等待,这取决于大小或您的数据库。但您也可以通过创建另一个函数来直接删除ldb。
例如:
you need to wait and its depending on the size or your database. but you can also delete the ldb directly by creating another function.
for example:
您需要等待连接关闭并且jet引擎删除ldb文件。
ldb 文件是由 Jet 数据库引擎创建的锁定文件
you will need to wait for the connection to close and the jet engine to delete the ldb file.
the ldb file is a lock file created by the Jet Database engine