Results 1 to 6 of 6
  1. #1
    Join Date
    May 2011
    Posts
    5

    Unanswered: Copying a mdb file

    i have to copy a mdb file into other file
    for that i wrote a code in vb


    Private Sub Command0_Click()

    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.CreateFolder "C:\database"
    fso.CopyFile "C:\S4.mdb", "C:\database\S4.mdb"

    End Sub


    but showing error as cannot find path



    any one can help me..................

  2. #2
    Join Date
    Jan 2009
    Location
    United Kingdom
    Posts
    77
    Does "c:\database" exist?

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Your code works as expected for me. I can only get it to error out when trying to run it a second time, because the folder C:\Database already exists.

    Do you have the necessary permissions to create a new folder?

    And, in line with Jack's question, was the folder Database created?

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    May 2011
    Posts
    5

    Mdb

    C:\database didn't exist at first time


    den also it shows error

    for the first time it is creating the folder

    but shows error in copyingfile line
    Last edited by Micky123; 05-16-11 at 03:49.

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Guess we should have asked does S4.mdb exist as a file in in C:\ ?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    May 2011
    Posts
    5

    S4

    ya S4.mdb exists in c:\

    den also showing the same error that

    PAth not found

Posting Permissions

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