How to backup ms access database in vb.net?
We’re gonna make a system for a certain company but our teacher doesn’t teach us at all, please help. Any idea on how to do it?
How to backup ms access database in vb.net? We’re gonna make a system for
Share
The simplest way to make a backup of an Access-Database (or any one-file-databases) is to simply copy the file. But watch out for Exception because the file might be locked.
Additionally you could allow the user to specify the location and filename to which the file should be copied to. That’s a rather trivial approach with simply utilizing the
System.Windows.FormscontrolsOpenFileDialogandSaveFileDialog.In case you wonder what those
RestoreDirectoryproperty is doing: Those two dialogs are moving the current directory of the application to the designated paths, which might yield interesting effects later on if you assume a still unchanged current directory. To prevent this behavior, we set this property.