| | |
Finding directory of VB project dynamically
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
•
•
hkdani - the only potential problem I can see with that is my database is in a different folder than what app.path return, the folders that each are in are in the same location, also I can't really go up a directory and specify the folder name because every time I install them then the folder names change - don't know why.
The installer should install the Program in a default location: usually the <Program Files > folder. You need to follow some good practices on your locations: (1) Data that will be used by All Users, should go in the All Users directory, and (2) Data that will be used for the personal user should go in that User's Directory.
•
•
•
•
Currently I am saving it to a directory that I know where it is (C:/Program Files/PortGen2.0)
•
•
•
•
Which allows me to save it, but not restore it because I don't know where to load the file if something were to happen to the old one.
But once you have those two locations saved, you have to program the code based on those values to restore your database. But the first time the program runs, you should have code running in the initialization phase that will save the Active Location, and then you need some kind of menu that spits out a form where you can save the restore location and probably use the same form for restoring your data.
•
•
•
•
hkdani - the only potential problem I can see with that is my database is in a different folder than what app.path return, the folders that each are in are in the same location, also I can't really go up a directory and specify the folder name because every time I install them then the folder names change - don't know why.
The installer should install the Program in a default location: usually the <Program Files > folder. You need to follow some good practices on your locations: (1) Data that will be used by All Users, should go in the All Users directory, and (2) Data that will be used for the personal user should go in that User's Directory.
•
•
•
•
Currently I am saving it to a directory that I know where it is (C:/Program Files/PortGen2.0)
•
•
•
•
Which allows me to save it, but not restore it because I don't know where to load the file if something were to happen to the old one.
But once you have those two locations saved, you have to program the code based on those values to restore your database. But the first time the program runs, you should have code running in the initialization phase that will save the Active Location, and then you need some kind of menu that spits out a form where you can save the restore location and probably use the same form for restoring your data.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: computer clock
- Next Thread: Control or Object (Other than MDI Form) In vb 6.0 which can hold a Form
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window





