Results 1 to 5 of 5

Thread: [RESOLVED] help me debugg this please

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2010
    Posts
    51

    Resolved [RESOLVED] help me debugg this please

    i want the code to collect from a folder and send it to cdlsave.Dir
    1 Code:
    1. Private Sub cmddownload_Click()
    2. Dim strSourceFileName As String
    3. Dim strDestination As String
    4.  
    5. On Error GoTo ERR_Handler
    6.  
    7.  
    8.     strSourceFileName = App.Path & "\server\" & Mid(strSourceFileName, InStrRev(strSourceFileName, "\") + 1)
    9.    
    10.     strDestination = cdlsave.FileName
    11.    
    12.        
    13.     FileSystem.FileCopy strSourceFileName, strDestination
    14.    
    15.     Exit Sub
    16.  
    17. ERR_Handler:
    18.  
    19.     MsgBox "An error has occured while copying file. Operation aborted.", vbExclamation, "File Copy Error"
    20.     Err.Clear
    21.    
    22. End Sub
    23.  
    24. Private Sub cmdsave_Click()
    25.     'upload file link into database
    26.     cdlsave.DialogTitle = "Upload File"
    27.     cdlsave.Filter = "All Files(*.*)|*.*|Office Document 1997-2000(*.doc)|*.doc|Office Document 2003-2010(*.docx)|*.docx|"
    28.     cdlsave.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
    29.     cdlsave.ShowSave
    30.    
    31.     txtsave.Text = cdlsave.FileTitle
    32. End Sub

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: help me debugg this please

    How can we debug it if you don't tell us what the problem is exactly? Are you getting an error? If so, what is the error message, what line is generating the error etc.

  3. #3
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: help me debugg this please

    This is yet another duplicate of:
    http://www.vbforums.com/showthread.php?t=627184
    and
    http://www.vbforums.com/showthread.php?t=627256

    If you keep to the original thread (or at least make a reference to it) we can all see the history of the problem, what's been tried and what's been suggested. By creating new threads for effecitvely the same question you are making it very difficult for us to answer, which can mean we just wont bother to try.

    As baja_yu has said, please tell us the exact error message you are receiving, or describe the exact problem you are experiencing - that gives us a fighting chance to suggest a resolution.

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

    Re: help me debugg this please

    Definitely let us know what the error is.

    Here is one of your problems.
    Code:
    strSourceFileName = App.Path & "\server\" & Mid(strSourceFileName, InStrRev(strSourceFileName, "\") + 1)
    Why a problem? strSourceFileName is declared in the same routine, therefore it has initial value of an empty string. The above line of code is same as this
    Code:
    strSourceFileName = App.Path & "\server\" & Mid("", InStrRev("", "\") + 1)
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2010
    Posts
    51

    Re: help me debugg this please

    Thanks alot guys find attached the conclusion of my Project work. if u have any comment to give about it please feel free to do so..
    Thanks
    Attached Files Attached Files

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