473,729 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting Default Path for OpenFileDialog

Hello, I have an application that uses an access database that is stored in my computer. I would like to set up a OpenFileDialog object to be able to select the source of this database (i.e. c:\database.mdb ). If I move the database to another location I would like to change the path to that other location. Once I change the location, I would like to have the new location of the database be the default location (the one that is used when you open up the application all the time) so that users can use my application. Any ideas or feedback on this will be greatly appreciated! Thanks!
Nov 15 '05 #1
3 6989
Let me add a bit more clarification.. .I would like to store the path of the database in the OpenFileDialog object that I have created and use that path every time a user opens up the application. the user will have the ability to choose a different path when the database is moved and that path should be the default path from that time on! Again, any help or ideas on this will be greatly appreciated! thanks!
Nov 15 '05 #2
you could store the path in the Registry for each user... and each you would
use OpenFileDialog
you would first load the string from the registry...

"Ed P." <an*******@disc ussions.microso ft.com> wrote in message
news:5B******** *************** ***********@mic rosoft.com...
Let me add a bit more clarification.. .I would like to store the path of

the database in the OpenFileDialog object that I have created and use that
path every time a user opens up the application. the user will have the
ability to choose a different path when the database is moved and that path
should be the default path from that time on! Again, any help or ideas on
this will be greatly appreciated! thanks!
Nov 15 '05 #3
How if you record the path in a ini file or xml file .. that file can be
used to store all the configuration details related to your application.

will it be a solution?

Nirosh.

"Ed P." <an*******@disc ussions.microso ft.com> wrote in message
news:5B******** *************** ***********@mic rosoft.com...
Let me add a bit more clarification.. .I would like to store the path of

the database in the OpenFileDialog object that I have created and use that
path every time a user opens up the application. the user will have the
ability to choose a different path when the database is moved and that path
should be the default path from that time on! Again, any help or ideas on
this will be greatly appreciated! thanks!
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3699
by: kelkel | last post by:
my app needs users to input a path, they can type or click a "browse" button to select it. I only know "OpenFileDialog" to select file, can i apply "OpenFileDialog" in this case? or is there any other methods to do this? many thanks~~~. Kel
7
55786
by: Sakharam Phapale | last post by:
Hi All, I want to give option to user for selecting directory, just like for selecting file using OpenFileDialog control. How to make it possible?
2
9941
by: VhD50 | last post by:
Hi, I'm using the OpenFileDialog to let the user pick a file, then I need to get the file name and file path of the picked file and store it in a database. My problem comes in when the user picks files from a network folder. Instead of getting the real file path, i.e. \\servername\sharedfolder, what I get is the drive letter of the mapped drive. So, instead of having the true path like '\\servername\sharedfolder\filename.txt', now I get...
1
2334
by: Shilpa | last post by:
Hi, I have a OpenFileDialog on my windows form whose filter is *.*. I want the users to be able to further filter the files by giving *.doc or *.zip etc in the "file name" field of the dialog (Just like it happens in the open file dialog of MS Word) Currently, if the user enters a wild card character in the file name field, it is throwing an exception with the message "Illegal characters in path". Please let me know how to achieve the...
1
6501
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
2
10989
by: vbaDev | last post by:
Hi. I am using Access 2000 and in my code I'm exporting a table into an Excel file (creating it), then the code needs to export another query into the same file (a new worksheet). So I needed both a "Save As" dialog and the ability to grab the filepath so that the second export appends to it. Anyway, I found Microsofts method and it works, except that I can't figure out how to populate the File Name box in the Dialog with a default name (say,...
2
4717
by: MikeY | last post by:
Hi everyone, I"m having a problem with the OpenFileDialog() changing my path to save to my .resources file. I'm a bit baffled why this is happening, even when I set the OpenFileDialog back to the inital directory where the .resource file resides. What I am trying to do is get the location of my database and save it to string format in my resource file (un-embedded). When I go to save this information to my .resouce file it creates...
5
4989
by: =?Utf-8?B?UGVy?= | last post by:
I want to change the current path in the OpenFileDialog in runtime. When the user presses OK-button I'm checking the selected path if it's valid for my application. If it's not valid I want to set the path to a valid one in the FileOk-event and set the e.Cancel = true.
6
23135
by: SpreadTooThin | last post by:
After I select a file with the OpenFileDialog, I get the file name with .FileName, but I want to know the drive and path where that file is. What function, method, class can I use in C# to get the drive and path?
0
8917
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.