Re: Saving DB to flash drive
From: Jack MacDonald (jackMACmacdonald_at_telus.net)
Date: 01/09/05
- Next message: NeeNeeMeadows: "Templates for medical transcription"
- Previous message: Jack MacDonald: "Re: Can I turn off the Access methods for saving a record?"
- In reply to: Todd Shillam: "Re: Saving DB to flash drive"
- Next in thread: Ed Robichaud: "Re: Saving DB to flash drive"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 09 Jan 2005 20:30:10 GMT
Coincidence... I recently experienced the inability of VBA FileCopy
function to copy an open file, and found a long thread on the topic
using google groups. My solution was to use Windows API "CopyFile"
function. In my case, it is for an often-repeated, mid-day, hot backup
of the database file. Permanent backups are made when the database is
closed.
On Sun, 9 Jan 2005 11:24:17 -0800, "Todd Shillam"
<tshillam@hotmail.com> wrote:
>Doug,
>
>I have to be honest here--haven't tried the FileCopy function yet. However, I do know how to code batch scripts--that's why I went this route.
>
>Although, I am always open to the idea of using a different approach, especially if its more effecient. Although, according to Ed's reply, it appears that FileCopy cannot be used to copy the file currently open--although I would like to test it myself. In contrast, I have used a batch script to copy an open Access application. Although, I usually instruct the user to wait before starting any read-write actions until the copying is finished.
>
>Best regards,
>
>Todd
>
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message news:OvTKizn9EHA.2600@TK2MSFTNGP09.phx.gbl...
> I'm curious, Todd, as to why you're recommending the round about way of
> calling a batch file when VBA has a FileCopy command built into it.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Todd Shillam" <tshillam@hotmail.com> wrote in message
> news:oq2dnQtMntLA63zcRVn-2g@comcast.com...
> Rocky,
>
> You can call a batch script using a command button that would copy your
> file. A batch file is coded using the DOS language.
>
>
> STEP 1) Copy the following, open Notepad, and paste the code inside. Save
> the file as Backup.bat and be sure to save it in the same folder as your
> application.
>
> ======== Copy Here =========
> @@echo off
>
> echo.
> echo ===============
> echo STARTING BACKUP
> echo ===============
> echo Please standby...
> ping localhost -n 3 > nul
>
> ::Edit the Location for your File and Where to Backup
> xcopy /q/y/c/e "C:\Program Files\ApplicationName\ApplicationFile.mdb"
> "E:\Backups\*.*" > nul
>
> cls
> echo.
> echo Backup Complete! Standby...
> ping localhost -n 3 > nul
>
> ======== End Here =========
>
> STEP 2) Copy the following code and paste it into a button's OnClick event:
>
>
> '=========================================
> 'DATE:
> 'AUTHOR:
> 'COMMENTS:
> '
> '1) This subroutine launches a MS-DOS
> 'batch script to perform a backup of
> ' the application.
> '=========================================
>
>
> 'DECLARING VARIABLE
> Dim strAppName As String
>
> 'INITIALIZING VARIABLE (EDIT THE LOCATION OF THE BATCH FILE IF NEEDED)
> strAppName = "C:\Program Files\ApplicationName\Backup.bat"
>
> 'CALLING MS-DOS BATCH SCRIPT TO PERFORM APPLICATION UPDATE
> Call Shell(strAppName, 1)
>
> STEP 3) Test the button and make sure it works!
>
> Best regards,
>
> Todd
> "Rocky" <anonymous@discussions.microsoft.com> wrote in message
> news:167801c4f662$38e9f0a0$a401280a@phx.gbl...
> hello all,
> Please can someone tell me. how do you save the entire
> database to a flash drive with code.
> I use the flash drive to carry files to and from work so
> that i can work on them at home.
> but i can not find a way to do this with an access db.
> Transferdatbase just let you transfer table, queries ect
> not the whole db.
> I can use exployer ie drag and drop but i would like to
> have a button on a form and do it with code.
> can this be done.
> please note..i am fairly new to access.
> thank you in advance.
> Rocky Rhodes
**********************
jackmacMACdonald@telusTELUS.net
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
- Next message: NeeNeeMeadows: "Templates for medical transcription"
- Previous message: Jack MacDonald: "Re: Can I turn off the Access methods for saving a record?"
- In reply to: Todd Shillam: "Re: Saving DB to flash drive"
- Next in thread: Ed Robichaud: "Re: Saving DB to flash drive"
- Messages sorted by: [ date ] [ thread ]