jimbrooking
Registered User.
- Local time
- Today, 02:31
- Joined
- Apr 28, 2001
- Messages
- 210
I have a split database. The path to the back end database is saved in a table. I want to let the user change the location of the back end so it can be moved, e.g., from its install directory to a LAN directory.
The back end tables are linked when the DB is opened and unlinked when it's closed, and all this seems to work fine.
I wanted to add to the "change back end" code the ability to make a copy of the current back end into the new location if it's not there already. I have written code to map a UNC path spec to a drive letter (if necessary), check that the target drive is valid, and build the specified subdirectories (if necessary).
At the point in the code where I know I have a valid destination directory, I do the delink procedure, which apparently works. (When I refresh the database window the linked files are gone.) But a FileCopy to copy the back end from its current location to the new one fails on an error 70 - permission denied.
When I check the existing/old back end directory I see an .ldb file for the back end. So something in Access's little brain thinks the back end is still in use. Does anyone have a clue about how to break this connection with the back end so I can copy it? Or an alternative suggestion about how to copy the back end?
I guess I could create an empty database in the new location and copy all the backend tables into it, but that seems like a lot of extra work.
Thanks,
Jim
The back end tables are linked when the DB is opened and unlinked when it's closed, and all this seems to work fine.
I wanted to add to the "change back end" code the ability to make a copy of the current back end into the new location if it's not there already. I have written code to map a UNC path spec to a drive letter (if necessary), check that the target drive is valid, and build the specified subdirectories (if necessary).
At the point in the code where I know I have a valid destination directory, I do the delink procedure, which apparently works. (When I refresh the database window the linked files are gone.) But a FileCopy to copy the back end from its current location to the new one fails on an error 70 - permission denied.
When I check the existing/old back end directory I see an .ldb file for the back end. So something in Access's little brain thinks the back end is still in use. Does anyone have a clue about how to break this connection with the back end so I can copy it? Or an alternative suggestion about how to copy the back end?
I guess I could create an empty database in the new location and copy all the backend tables into it, but that seems like a lot of extra work.
Thanks,
Jim