Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 10 of 10 total |
Programmatically removing the dbisam.lck file |
Wed, Mar 27 2013 12:38 PM | Permanent Link |
Mark Shapiro | Is there any way to release DBISAM's hold on the dbisam.lck file so that it can be deleted programmatically at run time other than by setting Engine.Active := false and then Engine.Active := true? This requires a re-entry of passwords for encrypted tables which I'd prefer not to do.
Mark Shapiro |
Wed, Mar 27 2013 12:53 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< Is there any way to release DBISAM's hold on the dbisam.lck file so that it can be deleted programmatically at run time other than by setting Engine.Active := false and then Engine.Active := true? This requires a re-entry of passwords for encrypted tables which I'd prefer not to do. >> As long as you close all open databases, you should be able to delete it. Just call this method of the TDBISAMSession to make sure that any non-explicit databases are closed: http://www.elevatesoft.com/manual?action=viewmethod&id=dbisam4&product=delphi&version=7&comp=TDBISAMSession&method=DropConnections If you have any other questions, please let me know. Tim Young Elevate Software www.elevatesoft.com |
Thu, Mar 28 2013 10:24 AM | Permanent Link |
Mark Shapiro | Tim,
Here is my code with your suggestion: if FileExists(CurDir + 'tables\dbisam.lck') then begin DBISAMSession1.DropConnections; DeleteFile(CurDir + 'tables\dbisam.lck'); end; I've also tried it by first setting DBISAMSession1.Active := false. In either case, DeleteFile returns false. Mark Shapiro |
Thu, Mar 28 2013 10:50 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mark
Reading the link Tim provided I'd say that doesn't close the normal tables so you'd need something like if FileExists(CurDir + 'tables\dbisam.lck') then begin DBISAMSession1.DropConnections; DBISAMSession1.Close; DeleteFile(CurDir + 'tables\dbisam.lck'); end; If that doesn't work then I'd download one of the unlock utilities to see just what is holding the file. Roy |
Thu, Mar 28 2013 12:34 PM | Permanent Link |
Mark Shapiro | Roy & Tim,
Unfortunately, that did not work. Enclosed is the dbisam.lck file I'm trying to delete. Mark Shapiro Attachments: dbisam.lck |
Fri, Mar 29 2013 5:34 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mark
Probably a silly question but there is only one instance of the app running isn't there? Roy Lambert [Team Elevate] |
Fri, Mar 29 2013 7:36 AM | Permanent Link |
Mark Shapiro | Roy,
>Probably a silly question but there is only one instance of the app running isn't there? Not silly, but yes, there is only one instance. Mark Shapiro |
Fri, Mar 29 2013 1:03 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< I've also tried it by first setting DBISAMSession1.Active := false. In either case, DeleteFile returns false. >> You can use the Windows unit's GetLastError function to get the last error code after a DeleteFile call fails under Windows. Add that to your code and let me know what the error code is. Thanks, Tim Young Elevate Software www.elevatesoft.com |
Tue, Apr 2 2013 9:34 AM | Permanent Link |
Mark Shapiro | Tim,
GetLastError returns a 32 -"The process cannot access the file because it is being used by another process." So now I have to figure out what that other process is. Mark Shapiro |
Tue, Apr 2 2013 12:25 PM | Permanent Link |
Mark Shapiro | Tim,
Great relief at this end. There was a threading event I'd completely overlooked that occurred before the code to delete the dbisam.lck file. When I moved it to a trailing position, the file was successfully deleted. Thanks for your help. Mark Shapiro |
This web page was last updated on Friday, April 19, 2024 at 07:09 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |