I am using MS SQL Server 2005 as DBMS for my WinForms App. Data is stored in encrypted archives containing .mdf and .log files. App is running with admin rights.
While app is using a given data file, .mdf and .ldf files are extracted to users temp folder and attached to DBMS. When file is closed from app menu, db is detached and db files are archived to original archive file, and deleted from users temp storage.
Everything has been working fine on my Win7, XP and Vista machines. But on some of clients Vista machines denial of access errors are logged, while app is moving detached .mdf and .ldf files to archive them. At the same time there are no such errors on other machines, having same OS (Vista) and antivirus (avast)
The main things to check are:
A better approach may be to ask SQL Server to handle the databases for you: restore/backup the database from/to your archive and drop it using SQL calls, rather than trying to modify the raw files yourself.