By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,500 Members | 830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,500 IT Pros & Developers. It's quick & easy.

Renaming a database after compact

P: n/a
(Using A2003 on XP)

I have tied in a 'CompactDatabase' (DAO) method for the Backend on the Exit
of the front end (split db). In that call I have to provide an olddb and a
newdb name. All is good so far.

After I have compacted the backend, I would like to rename the newly
compacted backend to that of the existing backend name, obviously replacing
it.

Whether I delete the original uncompated backend and then rename the new
one, I really don't care how I go about it. But how do I go about it
programmatically??

The users of this system are novices and I would not like to have to leave
instructions to do this manually from Windows Explorer.

Many thanks
Michelle


Nov 12 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
DFS
Use the FileCopy and Kill commands.

"-Michelle-" <mi********@yahoo.com> wrote in message
news:bv***********@otis.netspace.net.au...
(Using A2003 on XP)

I have tied in a 'CompactDatabase' (DAO) method for the Backend on the Exit of the front end (split db). In that call I have to provide an olddb and a newdb name. All is good so far.

After I have compacted the backend, I would like to rename the newly
compacted backend to that of the existing backend name, obviously replacing it.

Whether I delete the original uncompated backend and then rename the new
one, I really don't care how I go about it. But how do I go about it
programmatically??

The users of this system are novices and I would not like to have to leave
instructions to do this manually from Windows Explorer.

Many thanks
Michelle


Nov 12 '05 #2

P: n/a
On Mon, 26 Jan 2004 15:04:43 +1000, -Michelle- wrote:
(Using A2003 on XP)

I have tied in a 'CompactDatabase' (DAO) method for the Backend on the Exit
of the front end (split db). In that call I have to provide an olddb and a
newdb name. All is good so far.

After I have compacted the backend, I would like to rename the newly
compacted backend to that of the existing backend name, obviously replacing
it.

Whether I delete the original uncompated backend and then rename the new
one, I really don't care how I go about it. But how do I go about it
programmatically??

The users of this system are novices and I would not like to have to leave
instructions to do this manually from Windows Explorer.

Many thanks
Michelle


Is the Name oldpathname As newpathname statement still available in
2003? If so, try that.
--
Mike Storr
veraccess.com
Nov 12 '05 #3

P: n/a
Thanks Mike. Worked a treat!!
"Mike Storr" <st******@sympatico.ca> wrote in message
news:11******************************@40tude.net.. .
On Mon, 26 Jan 2004 15:04:43 +1000, -Michelle- wrote:
(Using A2003 on XP)

I have tied in a 'CompactDatabase' (DAO) method for the Backend on the Exit of the front end (split db). In that call I have to provide an olddb and a newdb name. All is good so far.

After I have compacted the backend, I would like to rename the newly
compacted backend to that of the existing backend name, obviously replacing it.

Whether I delete the original uncompated backend and then rename the new
one, I really don't care how I go about it. But how do I go about it
programmatically??

The users of this system are novices and I would not like to have to leave instructions to do this manually from Windows Explorer.

Many thanks
Michelle


Is the Name oldpathname As newpathname statement still available in
2003? If so, try that.
--
Mike Storr
veraccess.com

Nov 12 '05 #4

P: n/a
On Mon, 26 Jan 2004 17:03:32 +1000, -Michelle- wrote:

Cool. DFS's suggestion of the FileCopy/Kill commands may work better if you
are trying to do this between different drives, as I believe Name has this
restriction.

--
Mike Storr
veraccess.com
Thanks Mike. Worked a treat!!
"Mike Storr" <st******@sympatico.ca> wrote in message
news:11******************************@40tude.net.. .
On Mon, 26 Jan 2004 15:04:43 +1000, -Michelle- wrote:
(Using A2003 on XP)

I have tied in a 'CompactDatabase' (DAO) method for the Backend on the Exit of the front end (split db). In that call I have to provide an olddb and a newdb name. All is good so far.

After I have compacted the backend, I would like to rename the newly
compacted backend to that of the existing backend name, obviously replacing it.

Whether I delete the original uncompated backend and then rename the new one, I really don't care how I go about it. But how do I go about it
programmatically??

The users of this system are novices and I would not like to have to leave instructions to do this manually from Windows Explorer.

Many thanks
Michelle


Is the Name oldpathname As newpathname statement still available in
2003? If so, try that.
--
Mike Storr
veraccess.com

Nov 12 '05 #5

P: n/a
Thanks DFS for your reply. Much appreciated.

"DFS" <no****@nospam.com> wrote in message
news:10*************@corp.supernews.com...
Use the FileCopy and Kill commands.

"-Michelle-" <mi********@yahoo.com> wrote in message
news:bv***********@otis.netspace.net.au...
(Using A2003 on XP)

I have tied in a 'CompactDatabase' (DAO) method for the Backend on the Exit
of the front end (split db). In that call I have to provide an olddb and a
newdb name. All is good so far.

After I have compacted the backend, I would like to rename the newly
compacted backend to that of the existing backend name, obviously

replacing
it.

Whether I delete the original uncompated backend and then rename the new
one, I really don't care how I go about it. But how do I go about it
programmatically??

The users of this system are novices and I would not like to have to

leave instructions to do this manually from Windows Explorer.

Many thanks
Michelle



Nov 12 '05 #6

P: n/a
On Mon, 26 Jan 2004 09:47:16 -0500, Mike Storr <st******@sympatico.ca>
wrote:

Cool. DFS's suggestion of the FileCopy/Kill commands may work better if you
are trying to do this between different drives, as I believe Name has this
restriction.

That restriction is implied or maybe even stated in the help file, but
it works fine between drives - even removable drives (Zip).

I have used in different scenarios: Across a LAN for an automated
nightly backup and to a Zip drive for on-demand backup.

What I generally do is:

'Move file to destination
Name strSource As strDestination

'Compact it back to the original source
DBEngine.CompactDatabase strDestination, strSource
- Jim
Nov 12 '05 #7

P: n/a
On Mon, 26 Jan 2004 22:43:38 GMT, Jim Allensworth wrote:
On Mon, 26 Jan 2004 09:47:16 -0500, Mike Storr <st******@sympatico.ca>
wrote:

Cool. DFS's suggestion of the FileCopy/Kill commands may work better if you
are trying to do this between different drives, as I believe Name has this
restriction.

That restriction is implied or maybe even stated in the help file, but
it works fine between drives - even removable drives (Zip).

I have used in different scenarios: Across a LAN for an automated
nightly backup and to a Zip drive for on-demand backup.

What I generally do is:

'Move file to destination
Name strSource As strDestination

'Compact it back to the original source
DBEngine.CompactDatabase strDestination, strSource
- Jim


Good to know! I wonder if there is just something about it where they can't
guarantee that it will work and as such won't claim that it does?
I never used it across different drives myself.
--
Mike Storr
veraccess.com
Nov 12 '05 #8

P: n/a
On Mon, 26 Jan 2004 21:38:28 -0500, Mike Storr <st******@sympatico.ca>
wrote:
On Mon, 26 Jan 2004 22:43:38 GMT, Jim Allensworth wrote:
On Mon, 26 Jan 2004 09:47:16 -0500, Mike Storr <st******@sympatico.ca>
wrote:

Cool. DFS's suggestion of the FileCopy/Kill commands may work better if you
are trying to do this between different drives, as I believe Name has this
restriction.

That restriction is implied or maybe even stated in the help file, but
it works fine between drives - even removable drives (Zip).

I have used in different scenarios: Across a LAN for an automated
nightly backup and to a Zip drive for on-demand backup.

What I generally do is:

'Move file to destination
Name strSource As strDestination

'Compact it back to the original source
DBEngine.CompactDatabase strDestination, strSource
- Jim


Good to know! I wonder if there is just something about it where they can't
guarantee that it will work and as such won't claim that it does?
I never used it across different drives myself.
--
Mike Storr
veraccess.com

I don't know why it isn't acknowledged in help. I do know that others
use it in the same way as I - that's where I got the idea. Also, I
have never had a problem with it. In the LAN backup situation it has
run nightly for > 4 years flawlessly.

- Jim
Nov 12 '05 #9

P: n/a
I think MS must write their help files in the wee morning hours when they're
only half awake.
Seeing as how there are so many omissions, misprints and lack of examples in
they're earlier versions, and how the newer versions just simply don't tell
you anything, I think these groups will become more and more the mainstay of
information on Access.
"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote in message
news:40****************@news.west.earthlink.net...
On Mon, 26 Jan 2004 21:38:28 -0500, Mike Storr <st******@sympatico.ca>
wrote:
On Mon, 26 Jan 2004 22:43:38 GMT, Jim Allensworth wrote:
On Mon, 26 Jan 2004 09:47:16 -0500, Mike Storr <st******@sympatico.ca>
wrote:

Cool. DFS's suggestion of the FileCopy/Kill commands may work better if youare trying to do this between different drives, as I believe Name has thisrestriction.

That restriction is implied or maybe even stated in the help file, but
it works fine between drives - even removable drives (Zip).

I have used in different scenarios: Across a LAN for an automated
nightly backup and to a Zip drive for on-demand backup.

What I generally do is:

'Move file to destination
Name strSource As strDestination

'Compact it back to the original source
DBEngine.CompactDatabase strDestination, strSource
- Jim


Good to know! I wonder if there is just something about it where they can'tguarantee that it will work and as such won't claim that it does?
I never used it across different drives myself.
--
Mike Storr
veraccess.com

I don't know why it isn't acknowledged in help. I do know that others
use it in the same way as I - that's where I got the idea. Also, I
have never had a problem with it. In the LAN backup situation it has
run nightly for > 4 years flawlessly.

- Jim

Nov 12 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.