Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Button to backup

Geek News

Button to backup
Rod 12/9/2008 2:25:18 PM
I need to backup the database, Candidates, five days a week. I would like to
have a button to press which will backup Candidates to "J:\bak\Backup (Tue)",
"J:\bak\Backup (Wed)", etc., so it needs to determine the current day and
execute the backup.

Thanks MUCH!
Re: Button to backup
Stefan Hoffmann <ste5an[ at ]ste5an.de> 12/9/2008 2:35:05 PM
hi Rod,

Rod wrote:
[Quoted Text]
> I need to backup the database, Candidates, five days a week. I would like to
> have a button to press which will backup Candidates to "J:\bak\Backup (Tue)",
> "J:\bak\Backup (Wed)", etc., so it needs to determine the current day and
> execute the backup.
These methodes will help you:

Sub CopyDatabaseFile(DatabaseFileName, [OverwriteExistingFile],
[DisconnectAllUsers])
Member of Access.DoCmd

Sub MkDir(Path As String)
Member of VBA.FileSystem

Function Weekday(Date, [FirstDayOfWeek As VbDayOfWeek = vbSunday])
Member of VBA.DateTime

Function WeekdayName(Weekday As Long, [Abbreviate As Boolean = Falsch],
[FirstDayOfWeek As VbDayOfWeek = vbUseSystemDayOfWeek]) As String
Member of VBA.Strings
Returns localized weekday name

mfG
--> stefan <--
Re: Button to backup
Rod 12/9/2008 7:18:03 PM
I pasted the code and keep getting unexpected end or expected identifier
errors. All four Sub and Function lines are in red.

"Stefan Hoffmann" wrote:

[Quoted Text]
> hi Rod,
>
> Rod wrote:
> > I need to backup the database, Candidates, five days a week. I would like to
> > have a button to press which will backup Candidates to "J:\bak\Backup (Tue)",
> > "J:\bak\Backup (Wed)", etc., so it needs to determine the current day and
> > execute the backup.
> These methodes will help you:
>
> Sub CopyDatabaseFile(DatabaseFileName, [OverwriteExistingFile],
> [DisconnectAllUsers])
> Member of Access.DoCmd
>
> Sub MkDir(Path As String)
> Member of VBA.FileSystem
>
> Function Weekday(Date, [FirstDayOfWeek As VbDayOfWeek = vbSunday])
> Member of VBA.DateTime
>
> Function WeekdayName(Weekday As Long, [Abbreviate As Boolean = Falsch],
> [FirstDayOfWeek As VbDayOfWeek = vbUseSystemDayOfWeek]) As String
> Member of VBA.Strings
> Returns localized weekday name
>
> mfG
> --> stefan <--
>
Re: Button to backup
Stefan Hoffmann <ste5an[ at ]ste5an.de> 12/9/2008 8:48:23 PM
hi Rod,

Rod wrote:
[Quoted Text]
> I pasted the code and keep getting unexpected end or expected identifier
> errors. All four Sub and Function lines are in red.
Of course, these are just the methods. You still need to do some
programming.

http://www.google.de/search?q=backup+database+access+vba

btw, you don't need CopyDatabaseFile. Use

Sub FileCopy(Source As String, Destination As String)
Member of VBA.FileSystem

Also, I think, it would be a good idea to look at the examples in the
online help...


mfG
--> stefan <--

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net