Forum > Database

[SOLVED] Performing Maintenance on Dbf Files problem...

(1/2) > >>

1HuntnMan:
I created a form in which I open all tables used by the application in order to perform maintenance, i.e. packing and reindexing all the tables used by the application.  No issues but when I close the maintenance form, the tables are closed but I didn't close them. So, in the maintenance form OnClose event, I reopened the tables although I never closed them. This doesn't work.  When I close the maintenance form and return to the main form, the tables are closed.

Anyone know why this behavior is happening?

1HuntnMan:
The main form is just a contacts mgt. form. All the tables are open when the user selects File - Maintenance. The maintenance form kicks off when the user clicks Start and all the tables are packed and reindexed. After the process is completed and they close the Maintenance form, all the tables are closed on the main form. The user has to close out of the app. and restart it in order to use the app. properly. I'm thinking the only way to fix this is to get rid of the Maintenance form and just perform this process everytime the close the system.

1HuntnMan:
Resolved, just made the File Maintenance a different Application!

1HuntnMan:
Not solved, trying to fix this issue which probably a simple fix. Basically, just attempting to pack/re-index all the tables used by the app. The main form has all the tables in use, not a main form with no tables calling other forms which use the tables.  This is just a client/contacts simple but a bit more involved than a regular contacts mgt. program.  The main form is launched with all the tables open which is clients/contacts.  To perform maintenance on all the tables, which is another form called from the File-Maintenance main menu just does the packing and re-indexing. I can't get this to run because when the maintenance form is accessed and I start the maint. process, it immediately blows up with a file access issue with any of the tables from the main form even though I'm closing the tables just before the maint. form is launched.  I've attached the code from the maint. form along with the error screen shot. If anyone can see the issue more experienced than I would appreciate your input. Tks, 1HuntnMan

Handoko:
I am not very sure but from what you said:
- The mainform is launched with all tables open
- FrmRebldCntksDB is called for performing tables maintenance
- Running the FrmRebldCntksDB will cause file being used error

Are those above correct? If yes, I believe the fix should be in the mainform. This is my suggestion for fixing the issue:

In the mainform, you need to close all the tables before calling FrmRebldCntksDB and the form should be showed as a modal form, so the code should be something like this:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  DbfSTProvCodes.Close;  DbfCountries.Close;  DbfCategories.Close;  DbfContacts.Close;  FrmRebldCntksDB.ShowModal;  DbfSTProvCodes.Open;  DbfCountries.Open;  DbfCategories.Open;  DbfContacts.Open;

Navigation

[0] Message Index

[#] Next page

Go to full version