Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: File Copy


Message #1 by "Derrick A. Flores" <derrick_flores@s...> on Tue, 30 Oct 2001 16:08:14
Hello everybody,

I need to find a way to copy a file from one place to another.  I have a 

database that collects work instructions and have an option to attached 

supporting documentation to a record.  I have a designated folder on the 

network so that all supporting documents must be copied into this folder 

so that everybody can view them.  I use the database to capture the path 

for those documents.  What I need is to provide a way so that a person 

could copy the original document into the designated folder on the 

network.  I would like to do this within Access.  I'm dreaming of a form 

that will use an api to locate the original document and place the path 

into a text box (Original) and another text box that will have the default 

path to the designated folder on the network.  Then the user will click on 

the command button that will copy the original document into the 

designated folder.  This will be very useful for me, so that everything 

can done within Access.



Need a little help,

Derrick
Message #2 by brian.skelton@b... on Tue, 30 Oct 2001 16:24:31
Derrick



I'd suggest you go here: http://www.allapi.net/ and download and install 

the API Guide. This handy little program contains a complete list of 

Windows API functions, along with sample VB code - which can usually be 

converted to VBA code with a little work.



Once installed, search for the GetOpenFileName function (although a nice 

version of this API can also be found here: 

http://www.mvps.org/access/api/api0001.htm )which shows how to use the 

file open dialog box. Then have a look at the CopyFile function, which 

copies a file!



Hope this helps.



-BDS



> Hello everybody,

> I need to find a way to copy a file from one place to another.  I have a 

> database that collects work instructions and have an option to attached 

> supporting documentation to a record.  I have a designated folder on the 

> network so that all supporting documents must be copied into this folder 

> so that everybody can view them.  I use the database to capture the path 

> for those documents.  What I need is to provide a way so that a person 

> could copy the original document into the designated folder on the 

> network.  I would like to do this within Access.  I'm dreaming of a form 

> that will use an api to locate the original document and place the path 

> into a text box (Original) and another text box that will have the 

default 

> path to the designated folder on the network.  Then the user will click 

on 

> the command button that will copy the original document into the 

> designated folder.  This will be very useful for me, so that everything 

> can done within Access.

> 

> Need a little help,

> Derrick
Message #3 by Lonnie Johnson <prodevmg@y...> on Tue, 30 Oct 2001 08:29:29 -0800 (PST)
 Sounds like you need to use the ActiveX Common Dialog control to find the 

correct folder. Next you can use the file copy command to copy the file. 

FileCopy "c:\MyFolder\MyFile.ext", "f:\MyOtherFolder\MyFile.ext"

That's the basics. 



  "Derrick A. Flores" <derrick_flores@s...> wrote: Hello everybody,

I need to find a way to copy a file from one place to another. I have a 

database that collects work instructions and have an option to attached 

supporting documentation to a record. I have a designated folder on the 

network so that all supporting documents must be copied into this folder 

so that everybody can view them. I use the database to capture the path 

for those documents. What I need is to provide a way so that a person 

could copy the original document into the designated folder on the 

network. I would like to do this within Access. I'm dreaming of a form 

that will use an api to locate the original document and place the path 

into a text box (Original) and another text box that will have the default 

path to the designated folder on the network. Then the user will click on 

the command button that will copy the original document into the 

designated folder. This will be very useful for me, so that everything 

can done within Access.



Need a little help,

Derrick

Message #4 by "Derrick Flores" <Derrick_Flores@s...> on Tue, 30 Oct 2001 12:12:03 -0600
Thanks Roy and Lonnie I tottally forgot about the FileCopy function. I 

already had the api function that

uses the file dialog box to select a file. I just totally did a brain 

fart!

Thanks for reminding me of the things I'd forgotten.







Derrick A. Flores

Sony Semiconductor

Assoc. Systems Engineer

66318



>>> <brian.skelton@b...> 10/30 4:24 PM >>>

Derrick



I'd suggest you go here: http://www.allapi.net/ and download and install=20



the API Guide. This handy little program contains a complete list of

Windows API functions, along with sample VB code - which can usually be

converted to VBA code with a little work.



Once installed, search for the GetOpenFileName function (although a 

nice

version of this API can also be found here:

http://www.mvps.org/access/api/api0001.htm )which shows how to use the

file open dialog box. Then have a look at the CopyFile function, which

copies a file!



Hope this helps.



-BDS



> Hello everybody,

> I need to find a way to copy a file from one place to another.  I have 

a

> database that collects work instructions and have an option to 

attached

> supporting documentation to a record.  I have a designated folder on 

the

> network so that all supporting documents must be copied into this 

folder

> so that everybody can view them.  I use the database to capture the 

path

> for those documents.  What I need is to provide a way so that a 

person

> could copy the original document into the designated folder on the

> network.  I would like to do this within Access.  I'm dreaming of a 

form

> that will use an api to locate the original document and place the 

path

> into a text box (Original) and another text box that will have the

default

> path to the designated folder on the network.  Then the user will 

click

on

> the command button that will copy the original document into the

> designated folder.  This will be very useful for me, so that everything



> can done within Access.

>

> Need a little help,

> Derrick



Message #5 by "Pardee, Roy E" <roy.e.pardee@l...> on Tue, 30 Oct 2001 10:52:31 -0800
One other option would be to use the Microsoft Scripting runtime

library--that's got lots of nice file handling objects.  Set a reference to

scrrun.dll and have a look at the documentation at

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/ht

ml/sgworkingwithfiles.asp for a start.



HTH,



-Roy



Roy Pardee

Programmer/Analyst

SWFPAC Lockheed Martin IT

Extension 8487



-----Original Message-----

From: brian.skelton@b...

[mailto:brian.skelton@b...]

Sent: Tuesday, October 30, 2001 8:25 AM

To: Access

Subject: [access] Re: File Copy





Derrick



I'd suggest you go here: http://www.allapi.net/ and download and install 

the API Guide. This handy little program contains a complete list of 

Windows API functions, along with sample VB code - which can usually be 

converted to VBA code with a little work.



Once installed, search for the GetOpenFileName function (although a nice 

version of this API can also be found here: 

http://www.mvps.org/access/api/api0001.htm )which shows how to use the 

file open dialog box. Then have a look at the CopyFile function, which 

copies a file!



Hope this helps.



-BDS



> Hello everybody,

> I need to find a way to copy a file from one place to another.  I have a 

> database that collects work instructions and have an option to attached 

> supporting documentation to a record.  I have a designated folder on the 

> network so that all supporting documents must be copied into this folder 

> so that everybody can view them.  I use the database to capture the path 

> for those documents.  What I need is to provide a way so that a person 

> could copy the original document into the designated folder on the 

> network.  I would like to do this within Access.  I'm dreaming of a form 

> that will use an api to locate the original document and place the path 

> into a text box (Original) and another text box that will have the 

default 

> path to the designated folder on the network.  Then the user will click 

on 

> the command button that will copy the original document into the 

> designated folder.  This will be very useful for me, so that everything 

> can done within Access.

> 

> Need a little help,

> Derrick





  Return to Index