[AccessD] apiCopyFile

Gustav Brock gustav at cactus.dk
Thu Jul 3 08:21:41 CDT 2003


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
> '---------------------------------------------------------------



More information about the AccessD mailing list