[AccessD] apiCopyFile <SOLVED>

Sad Der accessd666 at yahoo.com
Thu Jul 3 08:48:50 CDT 2003


Hi,

thnx for the response. Andy also told this and you
guys are correct. It doesn't return anything. I
interpreted this a bit different.

It doesn't return anything but one should check the
outcome.

Thnx

Sander

--- Gustav Brock <gustav at cactus.dk> wrote:
> Hi Sad
> 
> It doesn't but it could.
> Add a line:
> 
> Public Function CopyFile(SourceFile As String,
> DestFile As String)
>
'---------------------------------------------------------------
> ' PURPOSE: Copy a file on disk from one location to
> another.
> ' ACCEPTS: The name of the source file and
> destination
> file.
> ' RETURNS: Nothing
>
'---------------------------------------------------------------
>   Dim Result As Long
>    If Dir(SourceFile) = "" Then
>       MsgBox Chr(34) & SourceFile & Chr(34) & _
>          " is not valid file name."
>    Else
>       Result = apiCopyFile(SourceFile, DestFile,
> False)
>    End If
>    CopyFile = Return
> 
> End Function
> 
> /gustav
> 
> 
> > can someone please confirm the following?
> > I found the code below in an application I have te
> > maintain (is this the correct word?).
> 
> > The comments say that it doesn't return
> > anything...wich is bulls#@#.
> 
> > As I see it apiCopyFile returns zero or one. 
> > Result   Meaning 
> >      0   Action Failed
> >      1   Action Success
> 
> > Is this correct?
> 
> > Regards,
> 
> > Sander
> 
>   
> > Declare Function apiCopyFile Lib "kernel32" Alias
> > "CopyFileA" _
> > (ByVal lpExistingFileName As String, _
> > ByVal lpNewFileName As String, _
> > ByVal bFailIfExists As Long) As Long
> 
> 
> > Public Function CopyFile(SourceFile As String,
> > DestFile As String)
> >
>
'---------------------------------------------------------------
> > ' PURPOSE: Copy a file on disk from one location
> to
> > another.
> > ' ACCEPTS: The name of the source file and
> destination
> > file.
> > ' RETURNS: Nothing
> >
>
'---------------------------------------------------------------
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


More information about the AccessD mailing list