Connecting Tech Pros Worldwide Help | Site Map

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

  #1  
Old June 12th, 2009, 09:20 AM
Newbie
 
Join Date: Jun 2009
Posts: 2
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
  #2  
Old June 12th, 2009, 10:27 AM
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194

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.
  #3  
Old June 12th, 2009, 10:52 AM
Newbie
 
Join Date: Jun 2009
Posts: 2

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.
  #4  
Old June 12th, 2009, 12:17 PM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,485
Provided Answers: 1

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 ?
  #5  
Old June 13th, 2009, 01:58 PM
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194

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.
  #6  
Old June 13th, 2009, 09:12 PM
daniel aristidou's Avatar
Needs Regular Fix
 
Join Date: Aug 2007
Posts: 493

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zen and the Art of Debugging C/C++ in Visual Studio jwwicks insights 0 August 7th, 2008 01:53 AM
dotnet deployment in the real world Thomas answers 3 November 22nd, 2005 05:52 PM
How to use same filename DLLs in a Exe?(One is) kinghuangz answers 2 November 15th, 2005 04:13 PM
dotnet deployment in the real world Thomas answers 3 July 21st, 2005 09:46 PM