Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Visual Basic Code: Familiar with a PATH like this? "//server/data/... " (https://www.askmehelpdesk.com/showthread.php?t=575193)

  • May 8, 2011, 11:41 AM
    LinfieldPA
    Visual Basic Code: Familiar with a PATH like this? "//server/data/... "
    I wrote a Visual Basic (5.0) program about 10 years ago and compiled an .exe file when I was done. At the time, the database file it used was on a server and written into the code was this path: "//server/data/systemhistory.mdb".

    I'm now trying to run the same previously compiled program on a stand-alone computer (i.e. no server). Is there some way I can make a local drive, partition, or whatever "appear" as "//server/data/"? If it was compiled using "Q:/data/" or something similar, I could just rename a drive partition "Q:", and stick the database file there... but "//server"?

    I used to be very familiar with what the "//server" meant, but like I said... it was 10 years ago!

    Thanks in advance for any help you can provide.
  • May 8, 2011, 04:28 PM
    Scleros
    Quote:

    Originally Posted by LinfieldPA View Post
    I used to be very familiar with what the "//server" meant

    No access to the original source code?

    A UNC path takes the form //ComputerHostName/Folders/Data.

    Workarounds:
    • Rename your current machine "server" and create a shared folder "data" to plop the database in.
    • Setup and network another machine (physical or virtual) named "server" to place the database on.
    • It might also be possible to edit the EXE with a hex editor to change the hardcoded path to another one with the same length.

    Hardcoding paths is always a bad idea.
  • May 8, 2011, 05:32 PM
    LinfieldPA
    Thanks Scleros! Renaming the machine and sharing a folder worked perfectly (and jogged my memory of what was going on)!

    I'm actually trying to locate all of the correct versions of forms, modules, etc. that were used when I compiled the .exe (I haven't even looked at it for 10 years, the hard drives that contained the files is long gone, and I have multiple floppy backups with different versions).

    I'm trying to run the .exe and compare to the project I'm REbuilding with those forms, etc. to compare it's functionality (it's a fairly complex program).

    (and yes, I knew hardcoding the path would EVENTUALLY come back to bite me in the a**!)

  • All times are GMT -7. The time now is 06:57 PM.