Question : UpDating Back end Tables with new properties with code

Hi all

We have a commercial MS Access application used at a number of clients. We have just created an update where we have had to change table properties.  One of the tables field properties has changed from Integer to Single for example. There are also new fields for some tables which are numeric and are used in calculated fields, so a null value will cause an error on old records that do not have any value when the new fields are added.

This seems like a tough one is there a simple answer? If not a complicated one will do.

Answer : UpDating Back end Tables with new properties with code

Here it is.
It all works well; however, it was not developed for large-scale commercial distribution, so there are no help files, and you may want to improve the interface for your clients.

Feel free to post back with specific questions about usage (or we can take that discussion to e-mail), but here are just a few notes to get you started:

1. Hold down Shift when you open it to bypass the auto-open form. Look at the VBA code behind the Patch form.
2. The back-end filename is hard-coded in Form_Open. I just enter the filename for the relevant application before I distribute the patch.
3. Look in Private Sub HelpB for the list of functions already in there. Copy, paste, and modify (with actual table & field names, etc.) sections from this procedure into the Patch procedure, which runs after the user browses for the back-end file.
4. I did not yet write any code to change field properties, as I have been fortunate enough to be able to do that manually; however, I have seen several posts online and understand the process I described in the four steps in my first message. I may be able to add that in there, or you can add it yourself.

TEST.TEST.TEST...Keep a non-upgraded copy of your BE around and run the tests on a copy until all works flawlessly. Remember, als: if not all customers can be expected to run every patch as it is issued, you will need to have a field in the BE indicating the BE version, matching a like entry in the FE, and issue cumulative patches that bypass already-applied portions. I have not yet made my code robust enough to recognize that the patch has already been run and will, for example, error out if attempting to create a table that already exists. This could all be added, though.
 
Back-end structure updating code
 
Random Solutions  
 
programming4us programming4us