473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Renaming a database after compact

(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
9 2674
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ColinWard | last post by:
Is there a way to compact the current database when the user clicks the exit button. Alternatively, what is the command line switch to compact the database when the user opens the database? ...
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
8
by: heather e blair | last post by:
We have an Access 2002 database of about 35 M with about 7 users. The data lives on the server (Windows 2000 server), while the queries, forms, reports, etc. live in a file that is on each...
14
by: L Mehl | last post by:
I tested a FE/BE application developed in A2000 on a A2002 machine and got this message when exiting the app. Clicking the only available button "OK", exits the application, as intended. The FE...
3
by: Paolo | last post by:
Hi, I am trying to compact and repair my database, however every time I try it comes up a message saying: Table: "TempMSysAccessObject already exists", whenever I try to look for this table I...
6
by: MLH | last post by:
I just used Tools / Database Utilities / Compact Database in Access 97 for the first time. Unlike Access 2.0, it does not ask me to furnish a filename for it to compact into. It just launched...
40
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the...
12
by: John Baker | last post by:
Hi: I have read a number of threads on the issue of compressing (compacting) Access data bases programmatically, and have been left confused. We are using Access 2000, and I need code that will...
8
by: BillCo | last post by:
I'm updating a legacy app with table naming that makes baby jesus cry. It's a bit of a spider web though... no telling when and where the tables will be called by name. So I wrote this for renaming...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.