Display Short Name of Current Database name

K

kon

I use shell to backup my database where I put the xcopy /N /Y,
/N for handling the big names and /Y not to prompt for overwrite.

Shell(command /c xcopy /n / y c:\myfile d:\)

Myfile I get it from the Database using
currentproject.name
How can I use the shortname of currentProject.Name
in case my Database name is bigger than 8 characters ?

The same I need to Know for Directory Short Name since I prompt the user
where he wants to backup the file.


Thanks in Advace

Kon
 
M

Marshall Barton

kon said:
I use shell to backup my database where I put the xcopy /N /Y,
/N for handling the big names and /Y not to prompt for overwrite.

Shell(command /c xcopy /n / y c:\myfile d:\)

Myfile I get it from the Database using
currentproject.name
How can I use the shortname of currentProject.Name
in case my Database name is bigger than 8 characters ?

The same I need to Know for Directory Short Name since I prompt the user
where he wants to backup the file.


Take a look at: http://www.mvps.org/access/api/api0020.htm

But, can't you use:

Shell(command /c xcopy /n / y "c:\myfile" d:\)

so you don't care about long names?

BUT, copying an open database is a very risky thing to do
because you have no way to guarantee that the database is in
a consistent state, especially in a multi-user scenario.
Your plan also suffers from it's inability to verify that
the copy is actually usable.
 
K

kon

I thank you for the Link code.

As about the backup of a mdb file can you please
suggest me any ways to do is safely. My mdb wont be a multi user database
but I would like to know if it was what you would have suggested me.

I thought that a TrasferDatabase (Where I can Export my tables to a specific
mdb is a good way right).

Thank you for the advice and the code again.
 
M

Marshall Barton

Backing up a file is too important to include with the
application you want to back up. It should be an
independent operation that enforces exclusive access to the
file and includes a verification step so you can be sure
that the data is actually usable.

This means that you need to use a separate program (possibly
in another mdb database).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top