Page 1 of 1

Getting SpecificOptions Values

Posted: Mon 24 Oct 2011 07:48
by Brob
I'm trying to acces the values of SpecificOptions for TuniConnection but they all seem to be blank.
What am I doing wrong ?

var
x : Integer;
OptionsList: TOptionsList;
begin
UniConnection2.ProviderName := 'Oracle';
OptionsList := TUniProvider(UniProviders.GetProvider(UniConnection2.ProviderName)).GetConnectionOptions;
memo1.Lines.Add( UniConnection2.ProviderName+ ' Options Count = '+ inttostr( OptionsList.Count)) ;
for x := 0 to OptionsList.Count -1 do
begin
memo1.Lines.Add( OptionsList[x].OptionName + ' = '+
UniConnection2.SpecificOptions.Values[OptionsList[x].OptionName] )
end;
end;

Output to Memo1 ->
Oracle Options Count = 23
CharLength =
Charset =
ClientIdentifier =
ConnectionTimeout =
ConnectMode =
DateFormat =
DateLanguage =
Direct =
HomeName =
OptimizerMode =
PoolingType =
PrecisionBCD =
PrecisionFloat =
PrecisionFMTBCD =
PrecisionInteger =
PrecisionLargeint =
PrecisionSmallint =
Schema =
StatementCache =
StatementCacheSize =
ThreadSafety =
UseOCI7 =
UseUnicode =

Posted: Mon 24 Oct 2011 08:06
by AlexP
Hello,

I've sent you sources of the application that demonstrate getting all SpecificOptions and their values to your e-mail.

P.S. The application is written using Delphi 2010.

Posted: Mon 24 Oct 2011 09:17
by Brob
Thanks AlexP

It looks like the part I was missing is to use the GetDefaultValue if the current value is blank.

Does access to the SpecificOptions values for all other UniComponents work in the same way ?

Posted: Mon 24 Oct 2011 11:43
by AlexP
Hello,

To get the list of SpecificOptions of other Uni components, you can use the corresponding properties of each component:

Code: Select all

  TUniProvider(...).GetSQLOptions
  TUniProvider(...).GetScriptOptions
  TUniProvider(...).GetLoaderOptions
  TUniProvider(...).GetDumpOptions
  ................