• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

.exe not working properly

here's the prob:
I made an app in VB in wich i acces a txt file containing simple text.
In design(creation) mode if i execute it read my file but when i start the compiled file(exe) it cannot open the txt file...i dont see the text and it doesn't make any error.

i did Open "Help.txt" For Input as nFic(a variable contaning FreeFile value)
since the file Help.txt is always in the same root than the main exe but its not working
is there any other way to give a not fixed path

cause my exe and txt file can be install anywhere on the pc


thanks!
0
Dayus
Asked:
Dayus
  • 6
  • 4
1 Solution
 
saurabhguptaCommented:
Hi Dayus,
Use:
Open App.Path & IIf(Right(App.Path, 1)="\", "Help.txt", "\Help.txt") For Input as #nFic

Regards
Saurabh
0
 
DayusAuthor Commented:
hmmm...

its not working...
it is in creation mode but as soon as it is compiled nothing...

maybe its becaus i use an install maker or something like that??
0
 
DayusAuthor Commented:
ok

its because when i create it in the root folder of my apps with the .vbp and .frm it actually work

but as soon that i move it somewhere else even if the help.txt file is there it dont show anything
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
saurabhguptaCommented:
Dayus,
> its not working...
Does the compiled .exe not execute at all?

Regards
Saurabh
0
 
DayusAuthor Commented:
the exe do execute

it work perfectly but it cant read the file
if it is compiled in the current folder where im doing my project it work

i can move the exe somewhere else where i could have put the txt file but it wont work but if i take my exe back in the main folder it work

seem like he attach that path with the Help.txt...

0
 
DayusAuthor Commented:
the exe do execute

it work perfectly but it cant read the file
if it is compiled in the current folder where im doing my project it work

i can move the exe somewhere else where i could have put the txt file but it wont work but if i take my exe back in the main folder it work

seem like he attach that path with the Help.txt...

0
 
saurabhguptaCommented:
Dayus,
If you have any "On Error Resume Next" statement in the code, remove it so that it does not hide errors.

Regards
Saurabh
0
 
DayusAuthor Commented:
dont have any...

but ive check the msdn library
it says that when u use the App.path it actually taking the path of the .vbp when in cration an .exe path when its the executable that is running

well since a compiled it in the same directory than the .vbp file its normal that it only work there...since this folder represent its App.Path

so if i make my exe in a folder if it is moved away his App.Path no longer work

maybe i should put in on the server...less problem its always at the same place
...
0
 
saurabhguptaCommented:
Dayus,
> well since a compiled it in the same directory than the .vbp file its normal
> that it only work there...since this folder represent its App.Path

> so if i make my exe in a folder if it is moved away his App.Path no longer work

App.Path always points to the directory the executable is currently inside, wherever you move it.

Regards
Saurabh
0
 
DayusAuthor Commented:
well why isnt this exe dont work!

anyway ill check this out another time its not that important for the moment

ill give you the point for helping me

thanks!
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now