Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative path problems.

Status
Not open for further replies.

Snipor

Programmer
Feb 23, 2001
92
US
This program I developed requires me to be able to save data files and load premade files also. Now I wanted to keep the the paths all relative so I wouldn't have any problems when the program is installed on another computer. Now, my program located at D:\Programming\Publisher Money New\pubmoney.vbp. Everything for this program is located there. So I figured if I saved a data file while running the program as "data.dat" it would go to D:\Programming\Publisher Money New\data.dat. But it doesn't, it goes to D:\Programming\Databases\data.dat. The same goes with a pre-made file. My program uses a pre made word file and loads it in and edits it in the program. Now I put the word file in D:\Programming\Publisher Money New\Word.rtf. Then in the program I would try to open it using rtb1.LoadFile ("word.rtf") , even tried "..\Word.rtf". But it doesn't work. I put the file in the D:\Programming\Database\ directory and it reads it in fine using rtb1.LoadFile ("word.rtf")

Why in the heck does it keep going to this directory? I want it to got where the program is located. Seems to me, if I save a file as ("data.dat") is should go directly to the directory it's located in. How can I fix this. The reason I ask, Is I need to make sure that my files are in the right spot when I package, so when the program installs on another computer, it can find it properly. Please help. This has irratated me, and it's getting close to package time.
 
Save the data file to App.Path & "\data.dat".

If the application is located in a Root Folder (D:\) then you should remove the backslash in the filename part. To automate this process, see thread222-43340 _________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top