Connecting Tech Pros Worldwide Help | Site Map

I want to run a program, while I have the files of it in 2 folders.

Newbie
 
Join Date: Jun 2009
Posts: 2
#1: Jun 12 '09
Hello everyone and good morning from Greece.
I need some help, PLEASE.

I made a program that needs a database file (.mdb) to open, if the database file is outside the program folder, creates an error and stoped running.

I dont want to have the database file in the program folder.

Is there any way to create another program, which i will give to it the path from my exe and the path from the database file to connect them some how and run the program?

Thank you
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194
#2: Jun 12 '09

re: I want to run a program, while I have the files of it in 2 folders.


May be u r using App.Path in your program. If yes, replace it with the full path of the folder containing database file.
Newbie
 
Join Date: Jun 2009
Posts: 2
#3: Jun 12 '09

re: I want to run a program, while I have the files of it in 2 folders.


Quote:

Originally Posted by smartchap View Post

May be u r using App.Path in your program. If yes, replace it with the full path of the folder containing database file.

Thank you smartchap for your answer, but the reason that i want to make another program to connect them is that my program will run in a difrent os and the database file will be in difrent path from one pc to another.
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,505
#4: Jun 12 '09

re: I want to run a program, while I have the files of it in 2 folders.


then how are you going to synch the database ?
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194
#5: Jun 13 '09

re: I want to run a program, while I have the files of it in 2 folders.


I think you must develop Client-Server type application for this.
daniel aristidou's Avatar
Needs Regular Fix
 
Join Date: Aug 2007
Posts: 493
#6: Jun 13 '09

re: I want to run a program, while I have the files of it in 2 folders.


why don't u simply use a filedialog for the user to select the database on first use of the program (easily done in new versions of vb. im not sure about older versions) , you can then store this in a text file which is located in the applications folder, or in the registry. Then on start-up make you program retrieve the path of the database to use in your application.
Also it sounds like you are looking for a solution that does not mean rewriting the application, From newer versions of vb, i think (im not 100% sure) the database connection string is stored in a settings file or the registry. (Try querying the registry to see if u can find the connection string in which case you can edit it. )

I think this Article will be of some use
Reply