ADO ConnectionString dialog as a property in my component?

From: nisbus (vk_at_elea.is)
Date: 12/20/03


Date: Sat, 20 Dec 2003 01:50:03 -0000

Hi,

I don't know if this is a good idea or not but I'm in the process of writing
a component that includes TADODataSets and a TADOConnection. It works great
so far but the only problem is the connectionString property of the
TADOConnection.
I've published the ConnectionString property but I don't know how to make
the options dialog appear in the object inspector.

I tried this:

procedure TIndustry.SetFConnectionStr(const Value: WideString);
begin
  if Connect.ConnectionString = '' then
    Connect.ConnectionString := PromptDataSource(0,'');
end;

It works in so far as when I clear the field in the object inspector and
press enter, I get the dialog, but it doesn't seem to save the settings to
the component. Do I have to save parts of the String to it's corresponding
properties or what?

Also, is this something you would strongly advise me not to do or could this
actually be a good idea?

The component is a copy of an interface I've written to do certain things
with an MSSQL server and I thought that if I could create a component for
all of the work I'd save my self tons of work when I create more databases
on the server for my app to connect to.

Thanks,
  nisbus



Relevant Pages

  • Re: how do you specify a port # when setting up a TadoConnection?
    ... >ConnectionString property in the object inspector. ... First have you run the Server network utility to make sure Tcp/IP is installed ... You may just have a corrupted MDAC. ...
    (borland.public.delphi.database.ado)
  • Re: Calling the ConnectionString Creator dialog
    ... >TADOConnection, clicking in the ConnectionString property you can bring up a ... I'm sure this is just the ADO dialog from micorsoft, ...
    (borland.public.delphi.database.ado)
  • a connection problem
    ... In the object inspector, I set the TADOConnection's connectionstring property with the wizard. ... What codes should I write in the run-time prosedure? ...
    (borland.public.delphi.database.ado)