-
Notifications
You must be signed in to change notification settings - Fork 562
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conn.close() but MS Access .laccdb (lock) file stays open #1279
Comments
Does the .laccdb file remain if you simply open the connection, wait a couple of seconds, and then close the connection? import time
import pyodbc
connection_string = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=…"
cnxn = pyodbc.connect(connection_string)
sleep_time = 3
print(f"Connected. Pausing for {sleep_time} seconds.")
time.sleep(sleep_time)
print("Closing connection.")
cnxn.close() |
It may be a driver bug, could you post an ODBC trace? The driver is supposed to cleanup upon connection close but perhaps it isn't doing that. |
Also, when you say "At end conn.close()" does it mean that your script terminates immediately after the |
Yes and I'm trying your suggestion to put a short sleep after the close. |
FWIW, I am unable to reproduce your issue with ACE for Access 2013 and an .accdb on my local hard drive. The .laccdb file is removed within one second of calling |
Aha! Dropbox folder.
BTW still have not had time to test with new pause-code you recommended.
Sincerely,
Scott Swain
https://OceanMedia.net
Sent with [Proton Mail](https://proton.me/) secure email.
…------- Original Message -------
On Monday, September 25th, 2023 at 14:49, Gord Thompson ***@***.***> wrote:
FWIW, I am unable to reproduce your issue with ACE for Access 2013 and an .accdb on my local hard drive. The .laccdb file is removed within one second of calling .close() on the connection, even if the script continues to run. Is your.accdb on a network share, by chance?
—
Reply to this email directly, [view it on GitHub](#1279 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFBST3LNEOYY4UJUT3EQODDX4HN35ANCNFSM6AAAAAA5EIP52Y).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Environment:
My issue:
Open database, read & write <-- all works fine.
At end conn.close()
.Laccdb file (MS Access lock file) stays visible in folder next to the .accdb file.
It's not a "slow" thing. I refresh, wait, etc. and that .Laccdb file is still there.
I can delete it manually but would like this to work the way it is supposed to.
Until I can figure out an elegant fix, I'll have my program delete the file.
The text was updated successfully, but these errors were encountered: