PC Review


Reply
Thread Tools Rate Thread

Copy a protected file else where - FileCopy Statement

 
 
=?Utf-8?B?TWljaGFlbA==?=
Guest
Posts: n/a
 
      24th Jun 2005
Hello,

I tried to use the FileCopy Statement to copy a file located in a read only
folder to an other folder that has no restriction. But it did not work and I
get an error message . Is there a way to do it in VB?
(It is for a MS Access 2000 Application)

Doing it manualy: Copy of files from the read only folder and paste to a
folder that has no restriction works in Windows Explorer. But I'm looking to
do it in VB from a command button...

Thanks,
 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      24th Jun 2005
Perhaps file is opened, then try to use API function:

Private Declare Function apiCopyFile Lib "kernel32" _
Alias "CopyFileA" _
(ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, _
ByVal bFailIfExists As Long) _
As Long

call apiCopyFile(strSource, strTarget, boolFailIfExists)

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"Michael" <(E-Mail Removed)> wrote in message
news:1DDFF314-A83B-4D66-846F-(E-Mail Removed)...
> Hello,
>
> I tried to use the FileCopy Statement to copy a file located in a read
> only
> folder to an other folder that has no restriction. But it did not work and
> I
> get an error message . Is there a way to do it in VB?
> (It is for a MS Access 2000 Application)
>
> Doing it manualy: Copy of files from the read only folder and paste to a
> folder that has no restriction works in Windows Explorer. But I'm looking
> to
> do it in VB from a command button...
>
> Thanks,



 
Reply With Quote
 
=?Utf-8?B?TWljaGFlbA==?=
Guest
Posts: n/a
 
      29th Jun 2005
It works!

Thanks,

Michael


"Alex Dybenko" wrote:

> Perhaps file is opened, then try to use API function:
>
> Private Declare Function apiCopyFile Lib "kernel32" _
> Alias "CopyFileA" _
> (ByVal lpExistingFileName As String, _
> ByVal lpNewFileName As String, _
> ByVal bFailIfExists As Long) _
> As Long
>
> call apiCopyFile(strSource, strTarget, boolFailIfExists)
>
> --
> Alex Dybenko (MVP)
> http://Alex.Dybenko.com
> http://www.PointLtd.com
>
>
> "Michael" <(E-Mail Removed)> wrote in message
> news:1DDFF314-A83B-4D66-846F-(E-Mail Removed)...
> > Hello,
> >
> > I tried to use the FileCopy Statement to copy a file located in a read
> > only
> > folder to an other folder that has no restriction. But it did not work and
> > I
> > get an error message . Is there a way to do it in VB?
> > (It is for a MS Access 2000 Application)
> >
> > Doing it manualy: Copy of files from the read only folder and paste to a
> > folder that has no restriction works in Windows Explorer. But I'm looking
> > to
> > do it in VB from a command button...
> >
> > Thanks,

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
force a FileCopy to copy over the file name Janis Microsoft Access 5 24th Jun 2009 02:10 AM
FileCopy to create folder and copy file Song Su Microsoft Access Getting Started 6 6th Mar 2008 06:44 PM
does the statement FileCopy complete before next statement is executed??? tw Microsoft Access Getting Started 4 22nd Apr 2005 11:01 PM
does the statement FileCopy complete before next statement is executed??? tw Microsoft Access 4 22nd Apr 2005 11:01 PM
Copy file from server to server using server control button FileCopy() HELP =?Utf-8?B?UGVyZG8=?= Microsoft ASP .NET 0 6th Feb 2004 08:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:17 AM.