dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: Really REALLY stuck -> "path not found" error 76

  1. #1
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142

    Really REALLY stuck -> "path not found" error 76

    I have built my app, and it works fine on my machines (2 x W2k) machines. I have deployed it to a Win NT machine, and after some fiddling with MDAC it works...

    I have since deployed to a client machine (W2K) and I am getting a Run Time error 76 - Path Not Found error. I have tried trapping this but I just can't.

    All external files are in their place, and no restrictions as such anywhere that I can see. I have don't know where else to look - I need a 'spy' program that can see what the code is doing.

    I have even installed VB onto the clients machine to run the code, and it works fine then. It's to do with the deployed version...

    HELP!!!!!!!

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    "Two cents" questions..

    First -even if it may sound silly...
    To deploy, did you use a setup procedure (ie: Package and deployment wizard,Innosetup, ...)?

    Second:
    you sure you are not looking for opening a file that could be in C:\ root or in a subfolder with a sintax near to:
    open App.path & "\yourfilename"
    ?
    as: if path is C:\ (or any root of disk), you will have an extra "\"...

    Third:
    (not sure about this, you will have to check)
    be careful in any case with App.path and CurDir, as -if I remembre it correctly- running from a link may give you strange results, as links may set a different "working dir"....
    Last edited by Cimperiali; September 11th, 2003 at 06:20 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142
    Hiya

    Right... Firstly thanks for the reply, and secondly - yes I did use the P & D wizard to compile my package...

    In my generic module, my declarations for paths is:

    Public install_drive As String
    Public image_path As String
    Public my_reports_path As String
    Public my_queries_path As String
    Public my_exports_path As String
    Public my_userdata_path As String


    And my initialisation lines are:

    image_path = install_drive + "\Reporter\Data\Images\"
    my_queries_path = install_drive + "\Reporter\My Queries\"
    my_reports_path = install_drive + "\Reporter\My Reports\"
    my_exports_path = install_drive + "\Reporter\My Exports\"
    my_userdata_path = install_drive + "\Reporter\Data\"



    All these exist on the client machine, and my app does not have ANY hard coded paths whatsoever.


    As I said, I can't seem to trap this error. It does obviously happen when it's about to open a file, but I have logged the to-be opened path+file to see if it is correct, and it is.. so I am truly stumped still..

  4. #4
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142

    a bit more info

    right.. I've narrowed this problem down to one file called 'userdata.dat'

    Access to other files works, but this one is tripping up the app (it's just a txt file really).

    The weird but is.. if I RENAME the file to 'olduserdata.dat' the error is 53 - File not found. If I leave it there as 'userdata.dat' the error is the old 76 - Path not found.

    Anyone... Cimperiali???


    Pretty please?

  5. #5
    Join Date
    May 2002
    Location
    Montreal
    Posts
    450
    Is userdata.dat a database of some kind?

    We use Btrieve as a backend, and the drivers connecting to the database do not like it at all when there is a space in the path. We can't place a local database under the "Program Files" because of that. That produces an error similar to what you 're getting.
    Cheers,
    Laurent

    For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.

  6. #6
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142

    Unhappy

    Hi

    No, 'userdata.dat' is a complex text string which stores user's display preferences for the app (colors etc...).

    There are no spaces whatsoever in the path anyway:

    C:\Reporter\Data\


    Thanks for the help so far, anyway!

  7. #7
    Join Date
    May 2002
    Location
    Montreal
    Posts
    450
    Maybe post the code that attemps to open the file. I can't see anything wrong with what you indicated already.
    Cheers,
    Laurent

    For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.

  8. #8
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142
    Hi

    Well, the code that opens the file couldn't be more simpler:

    Open my_userdata_path & "userdata.dat" For Input As #1
    Do While Not EOF(1)
    ui = ui + Input(1, #1)
    Loop
    Close #1


    Basically it reads it into the string 'ui'.

    Cheers
    Andy

  9. #9
    Join Date
    May 2002
    Location
    Montreal
    Posts
    450
    You can try that, Assuming that my_userdata_path ends with a '\\'. Again I don't see why your code does not work. I usually use the same.
    Code:
                   'read in binary file
                   Open Trim(my_userdata_path & "userdata.dat") For Binary As #1
    
                   stri = ""
                   While Not EOF(1)
                       x = String(1, " ")
                       Get #1, , x
                       stri = stri + x
    
                   Wend
                   Close #1
    x and stri are Strings.
    Cheers,
    Laurent

    For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.

  10. #10
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142
    Now I think I'm getting somewhere...

    When I read in the file 'userdata.dat', the code fills in values on a another dialog form..

    It seems that everytime this other dialog is referenced, or written to etc... the error happens.

    What are the rules when, say filling in a text box, or ticking a tick box on a separate form..???

  11. #11
    Join Date
    May 2002
    Location
    Montreal
    Posts
    450
    If you are in form1 and want to fill in controls in form2 then you can use:

    form2.text1.text = "abc"

    Where does the error happen? On form1 or form2? And what control generates it?
    You don't want to open form2 in a modal mode. Does that make sense?
    Cheers,
    Laurent

    For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.

  12. #12
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142

    Unhappy

    I am referencing 'form2' (called dlg_options) in the way you mention.. which I believe correct (after all, this app works on my W2K machines (VB installed) and an NT machine (no VB)).

    The code I am using to reference, as an example is:

    dlg_options.lst_recipients.Clear
    emails = Split(Mid(ui, t1, t3), ",")
    recep_num = UBound(emails)
    For z = 0 To recep_num - 1
    dlg_options.lst_recipients.AddItem (emails(z))
    Next z

    Basically populating a list box from an exploded string..


    Other references include setting background colors, and ticking boxes. All done in the same simple way as:

    dlg_options.tck_eimage.Value = Val(colors(0))


    I am so stuck on this one!

  13. #13
    Join Date
    May 2002
    Location
    Montreal
    Posts
    450
    I can see 2 points from there:

    1)I guess if it is running on your development machine, then some components are missing on the target computer during the installation.

    2)The other point would be that the path to 'userdata.dat' gets modified in some way when you take values from the other form into account.

    hth
    Cheers,
    Laurent

    For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.

  14. #14
    Join Date
    Dec 2000
    Location
    Miami, Florida
    Posts
    142

    Unhappy

    Hi there

    Well... this particular dialog that is being referenced has some standard controls, plus it calls the common dialog control - I checked the COMDLG32.DLL files on the client machine compared to mine, and they are at least the same KB size.

    The 2nd possibility suggested isn't the case. I've tried displaying the variable I defined globally as the path, immediately before it is accessed, and it doesn't get modified at all.

    I may try removing references to the common dialog (I only use it to choose colors), and see if it is falling over there.

    Of course, any other ideas or suggestions would be wonderful.


    Cheers!

  15. #15
    Join Date
    Dec 2001
    Posts
    6,332
    Does the form have any pictures/skins loading? From the error you get by changing the name, my guess is that it IS finding the dat file, but the loading of the form itself is causing the error. I think it's a path to another file which is wrong, like a background image or something. If any paths are user selectable, and you save the path in the dat file, that path will obviously be at the default until the prefs are loaded.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Page 1 of 2 12 LastLast

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)