Results 1 to 7 of 7

Thread: FileCopy Mystery

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Carlsbad, CA
    Posts
    106

    Question FileCopy Mystery

    My application has 14 mdb files and I am writing a backup routine. Using filecopy,sourcefile,destinationfile in the routine. 13 of the files copy and on one I get the error message "permission denied".

    I have checked for any differences in file structure and attributes, none. Have gone to DOS and copied. Copied the file to a different name and then copied back with no difference in result.

    Any thoughts on what could be happening?

    Thanks again, and again to all you experts.
    Sometimes to get what you want, you must give up what you have.

  2. #2
    Addicted Member Martin Wilson's Avatar
    Join Date
    Mar 2002
    Location
    :)
    Posts
    236
    Could it be in use by another program?
    What is the answer to this question?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Carlsbad, CA
    Posts
    106

    Response

    No, sad to say.
    Sometimes to get what you want, you must give up what you have.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    One thought one question.

    Question: Can you copy the database from one place to another using the standard copy from Windows Explorer?

    Thought: Try using VB's SetAttr to ensure the Db's propertys are set only to Archive.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Carlsbad, CA
    Posts
    106

    Reply

    If I eliminate the FileExists call then the file will copy.

    If FileExists("cdata.mdb") Then
    frmBusiness.txtBusinessName = frmCompany.txtCompany
    End If

    Public Function FileExists(ByVal FileName As String) As Boolean
    FileExists = ((Len(FileName) > 0) And (Len(Dir$(FileName)) > 0))
    End Function

    There is a data control on frmCompany using cdata.mdb.

    If this action opens the file, how do I close.

    Thanks.
    Sometimes to get what you want, you must give up what you have.

  6. #6
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Here's another method that you could use.


    Dim F As File, FSO As New FileSystemObject
    Dim S as string

    S = "C:\Test.txt"

    If FSO.FileExists(S) Then
    Set F = FSO.GetFile(S)
    F.Copy "C:\CopyTest.txt", True
    End If
    That which does not kill us, only makes us stronger.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Carlsbad, CA
    Posts
    106

    Try again

    My question was, "if the following opens the file, how do I close"

    frmBusiness.txtBusinessName = frmCompany.txtCompany

    (frmCompany has a data control tied to cdata.mdb)
    Sometimes to get what you want, you must give up what you have.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width