VBAHole22 Posted September 8, 2004 Posted September 8, 2004 Is there a way to use the FileAttributes properties and methods to kill an mdb that is open and locked? I have a third party library that is clinging to mdb's like they were going out of style. I want to kill the lock and delete the database, regardless of what the application thinks about it. Can I do this? Right now the only way I can delete the mdb is if I kill the aspnet process from the previous run. I've looked deeply into releasing all of the COM objects and references to no avail. Now I just want to kill, kill , kill Access files. Quote Wanna-Be C# Superstar
Moderators Robby Posted September 9, 2004 Moderators Posted September 9, 2004 How are you releasing the COM object? Quote Visit...Bassic Software
VBAHole22 Posted September 9, 2004 Author Posted September 9, 2004 Finally Marshal.ReleaseComObject(pFWrkSpace) Marshal.ReleaseComObject(g) Marshal.ReleaseComObject(pWrkSpcFactory) Marshal.ReleaseComObject(pFeatureDataset) Marshal.ReleaseComObject(pGPMessages) g = Nothing pFWrkSpace = Nothing pWrkSpcFactory = Nothing pFeatureDataset = Nothing pGPMessages = Nothing GC.Collect() COMSupport.AOUninitialize.Shutdown() Try Dim fileIOPerm1 As FileIOPermission If File.Exists(Destgdb) Then fileIOPerm1.AddPathList(FileIOPermissionAccess.Write, Destgdb) File.Delete(Destgdb) End If Catch ex As Exception Me.TextBox1.Text &= ex.Message End Try End Try Quote Wanna-Be C# Superstar
bri189a Posted September 9, 2004 Posted September 9, 2004 I would think that once you kill the 3rd party tool that isn't correctly releasing the database that you could use System.Management to get the open processes and then kill the process from there. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.