[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ADO Connection String

Posted on 2001-09-05
4
Medium Priority
?
230 Views
Last Modified: 2013-11-23
Hi Guys,
   Any idea how I launch the connection string dialogue through code and recieve the connection string.

{
In the ADOConnection component clicking the ... button next to the connectionstring property causes a connection string dialogue with a BUILD button that lets you build your connection string
}

I need to be able to launch that dialogue though code.

Many Thanks
John.
0
Comment
Question by:WoodyJ007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6456202
Hello

  I don't know if i understand you well, but if you want to set the connectionstrings from code, this code, will connect to access database the file on the c:\

procedure TForm1.Button1Click(Sender: TObject);
begin
  ADOTable1.ConnectionString. := 'Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=c:\db1.mdb;Persist Security Info=True';
  ADoTable1.TableName := 'Users';
  ADOTable1.Active := True;
end;
0
 

Author Comment

by:WoodyJ007
ID: 6456261
I want to show the dialog.  With the ConnectionString Dialogue you can choose many different types of connection.
0
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 6456266
hi,
to show the dialog at runtime you can do:

procedure TForm1.Button1Click(Sender: TObject);
var
s : string;
begin
  if adoconnection1.connected then
  begin
    adoconnection1.Connected:=false;
  end else
  begin
    s := adoconnection1.ConnectionString;
    s := adodb.PromptDataSource(self.Handle, s);
    adoconnection1.ConnectionString := s;
    try
      adoconnection1.connected:=true;
    except
    end;
  end;
  memo1.text := s;
end;
0
 

Author Comment

by:WoodyJ007
ID: 6456275
thats great.

Thanks
Woody.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

656 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