Howto get the list of providers at runtime

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Howto get the list of providers at runtime

Post by jfudickar » Sun 24 Jun 2012 13:58

How can I get the list of available providers at the runtime?

Regards
Jens

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Howto get the list of providers at runtime

Post by bork » Mon 25 Jun 2012 12:00

Hello

To get list of available providers names, you should execute the following code:

Code: Select all

uses
  UniProvider;

var
  UniProviderNames: TStringList;
begin
  UniProviderNames := TStringList.Create;
  try
    UniProviders.GetProviderNames(UniProviderNames);
  finally
    UniProviderNames.Free;
  end;
end;
Get the UniProvider instance by name you can with using the following code:

Code: Select all

  UniProvider := UniProviders.GetProvider(UniProviderName);

Post Reply