Results 1 to 8 of 8

Thread: [vb6] File Copy error

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    8

    [vb6] File Copy error

    Hello..
    I'm kinda new here..

    i'm having a problem with file copy and limits of incorrect pw.
    here is my code..
    the backup button:
    Code:
    Private Sub cmdBackup_Click()
        SourceFile = App.Path & Text1
        DestinationFile = App.Path & Text2
        fs.CopyFolder SourceFile, DestinationFile
        Set fs = Nothing
        Timer1.Enabled = True
    End Sub
    and the browsing part is this:
    Code:
    Private Sub cmdBrowse1_Click()
    With cd
            .CancelError = False
            .Filter = "All Files (*.mdb)|*.mdb"
            .ShowOpen
            Text1 = .FileName
            If Len(.FileName) = 0 Then
                Exit Sub
            End If
            sFile = .FileName
    End With
    end sub
    i'm having an error msg "Bad file name or number"
    i set my reference to microsoft scripting runtime
    can you help me??

    and also..
    can you teach me how to limit the incorrect password of users??

    please please help me..
    badly needed for thesis..
    tnx tnx..
    Last edited by Hack; Dec 19th, 2007 at 11:26 AM. Reason: Added Code Tags

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

    Re: [vb6] File Copy error

    Welcome to the forums.

    I added [code]your code goes here[/code] tags to your post as it makes reading posted code a lot easier.

    How about
    Code:
    SourceFile = App.Path & "\" & Text1.Text
        DestinationFile = App.Path & "\" & Text2.Text

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    8

    Re: [vb6] File Copy error

    Quote Originally Posted by Hack
    Welcome to the forums.

    I added [code]your code goes here[/code] tags to your post as it makes reading posted code a lot easier.

    How about
    Code:
    SourceFile = App.Path & "\" & Text1.Text
        DestinationFile = App.Path & "\" & Text2.Text
    I tried it and it's still the same error..
    I'm confused..

    tnx for editing my post...
    Last edited by akire1212; Dec 19th, 2007 at 11:48 AM. Reason: thanking Hack for editing my post

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

    Re: [vb6] File Copy error

    What is contained the textbox? (the exact string)

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    8

    Re: [vb6] File Copy error

    the exact filename and directory actually..
    example : "C:\My Docu\masterfile.mdb"
    like that..

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [vb6] File Copy error

    You are using CopyFolder not CopyFile; your source & destination appear to be files.

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

    Re: [vb6] File Copy error

    Is the database closed when you attempt to copy it?

  8. #8

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    8

    Re: [vb6] File Copy error

    ei.. tnx now i get it!

    tnx so much.,.,

    i've replaced the copyfolder.
    tnx xo much!

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