Solved

Open folder

Posted on 2003-11-19
6
945 Views
Last Modified: 2008-02-01
Hi.. I'm using Delphi 6 in Windows XP, and I want the user to choose the folder name in which he will use the data in that folder as the database. I want to get the folder name which the user has chosen.. Is it using Open Dialog Box or using something else? Any help will be very much appreciated :) Thanksss..
0
Comment
Question by:pipinana2002
  • 2
  • 2
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 9785043
there is a selectdirectory-function

a sample

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses filectrl; //filectrl is used

procedure TForm1.Button1Click(Sender: TObject);
var s : string;
begin
  s := '';
  if selectdirectory(s,[],0) then
    showmessage('Directory '+s+' is selected');
end;

end.

meikl ;-)
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 9785061
pipinana2002,
  You could use:
1) TDirectoryListBox from Win3.1
2) TDirectoryEdit from RX components (http://sourceforge.net/projects/rxlib/)
  for selecting folder names.
HTH,
...Snehanshu
0
 

Author Comment

by:pipinana2002
ID: 9785070
Hi meikl..

Thanks for your help :)

Can I actually remove the files and drives list from the display?

Thanks againn.. :)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:snehanshu
ID: 9785072
Thanks meikl,
  I did not know about that!
  pipinana2002: you have the solution from the best.
:-)
...Snehanshu
0
 

Author Comment

by:pipinana2002
ID: 9785091
Hi again meikl.. I already found how to do it.. hehehehehe thanks a lot for your helpp :):):) U're really great! :)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9785271
glad you got it,

to use another dialog-style,
just use the other syntax

procedure TForm1.Button1Click(Sender: TObject);
var s : string;
begin
  s := '';
  if selectdirectory('Select A Directory','',s) then
    showmessage('Directory '+s+' is selected');
end;

meikl ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi with SQL Natvie Client 15 86
How to use Hashing sha1 in Delphi 2010 4 201
Communication Between RC4 Delphi <-> PHP 3 100
Delphi IDE crash without error message ... 7 76
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now