posted on August 03, 2012 04:08
One of the unique features of an MS Access database solution is the fact that it’s a single file-solution: tables, queries, macro’s and Visual Basic code are stored in one mdb-file. For security-reasons it is a good practice to store the data in a separate, so called Back-end, file. So as an Access-developer you are used to handle just 2 files for your application. A LightSwitch-application follows a whole kind of different approach and uses the normal Visual Studio project-file-structure as shown here:
The difference between the two Access-files and the files of a Lightswitch project is obvious, but why should you care about it?
Well, in case you would like to backup your work you might get into some trouble ! Let me explain.
A good scenario for organizing your desktop or laptop is to separate your Windows-files from your data-files by storing them on different harddisk or partitions.This makes backups of your data-files real easy and in case of an windows- or harddisk crash you just have to replace your windows-setup with an image and your data-files can be retrieved form your backup. With installing Visual Studio you'll have noticed that the installprogram will add a directory Visual Studio 2010 and a few subdirectories under the Documents directory of your user-files and you don't have the opportunity to choose another location in the install-screens. These directories will be used by Visual Studio as the common default places to store and publish your projects and therefore usually should fall in your category of “files for my backup”. But as they are residing on your Windows-partion/disk they conflict with the separation-criteria as stated above !
A simple solution would be to make a copy of the Visual Studio directories mentioned above and place them on your data-partition/harddisk and continue to work from there. Problem solved……but beware of the following !! When you place your directory “Visual Studio 2010” of few directories more down in your directory-tree and especially when you do the same with your backup-directory, the chance that your individual filesnames reach the windows maximum of 260 characters rapidly increases and you could end up with errors during your backup-proces. And in case you've chosen the option to skip errors during your backup-proces, you'll might end up with an incomplete Lightswitch-project.
The above situation happened to me last week, as I was trying to recover my laptop from a windows-crash, so it isn't pure a theoretical situation ! My advice: if you choose to place your Visual Studio directories on your data-partition/didk, place them right under the root of your drive-letter ( e.g. D:\Visual Studio 2010) and the risk of backup errors is as low as possible !