Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2007

Tip: Looking for answers? Try searching our database.

FileCopy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trever B - 01 Mar 2007 06:38 GMT
Hi,

Thanks in advance,

I am using  FileCopy to transfer files thru Access like:-      

strFrom = "c:\database\text.txt"

strTo = ?

FileCopy strFrom, strTo

in my access procudure.

I know how to copy from a specific location but how does one copy to desktop?

Thanks

Trev
Stefan Hoffmann - 01 Mar 2007 09:31 GMT
hi Trever,

> I know how to copy from a specific location but how does one copy to desktop?
Try %userprofile%\Desktop as destination folder.

mfG
--> stefan <--
Dirk Goldgar - 02 Mar 2007 03:12 GMT
> hi Trever,
>
>> I know how to copy from a specific location but how does one copy to
>> desktop?
> Try %userprofile%\Desktop as destination folder.

That didn't work for me as is, but this did:

   strFrom = "C:\Temp\Test.txt"
   strTo = Environ("userprofile") & "\Desktop\Test.txt"
   FileCopy strFrom, strTo

Granted, the environment string may not be present in all versions of
Windows, and could be doctored externally.  One could also take the more
complicated approach of calling the Windows API to get the desktop
folder, using the code posted here:

   http://www.mvps.org/access/api/api0054.htm
   API: Retrieving a Special Folder's location

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Bob Bonta - 06 Mar 2007 21:08 GMT
Hey guys!

Try using this folder location in the destination variable:
    "C:\Documents and Settings\All Users\Desktop\"

This will even preclude the security issue of writing to the desktop of
another user who might not possess the appropriate permissions.  All users
can write/modify the contents of the 'All Users' profile.

Signature

~ Bob Bonta ~

> > hi Trever,
> >
[quoted text clipped - 15 lines]
>     http://www.mvps.org/access/api/api0054.htm
>     API: Retrieving a Special Folder's location
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.