473,698 Members | 2,295 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 6987
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
3697
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
55781
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
9936
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
2332
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
6493
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
10985
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
4715
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
4987
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
23131
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
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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
9028
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...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7728
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...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.