Results 1 to 2 of 2

Thread: Filecopy problem please someone help me!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    Hi, I was writing a Personal Directory for my self and I have a function in my program which would copy the databse to some other place well I used the filecopy function. like:
    source = "c:\dbase.dat"
    Distination = dirdistination.path & "\dbase.dat"
    file copy source, Distination
    well the above code does work perfectly as long as my path is forexample:
    c:\program files
    then the program would put the file in
    c:\program files\dbase.dat
    but if my starting path is
    a:\
    then I get an error message labeling path not found because what would happen is the path would look like this
    a:\\dbase.dat
    Well, I am just looking for a way to solve this problem. I know there are some way but I just can't find them. Please I really need help.
    Thanks Alot

    ======================
    VB Learner
    MMSS
    ++++++++++++++++++++++

  2. #2
    Member
    Join Date
    Jan 2000
    Posts
    35

    Post

    before : Distination = dirdistination.path & "\dbase.dat"

    check dirdistination.path like this: if right(dirdistination.path,1) <> "\" then dirdistination.path = dirdistination.path & "\"

    next, instead of dirdistination.path & "\dbase.dat" use this : Distination = dirdistination.path & "dbase.dat"

    that should remove the \\ problem

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