Page 1 of 1

Error when connecting to Advantage Tables

Posted: Thu 14 Mar 2013 23:17
by rockbone
Hi,

I'm testing UniDAC components (4.6.12 for Delphi XE - Trial Edition). The Oracle Direct mode works as a breeze, but I can't connect to Advantage tables.

I'd installed Advantage ODBC Driver 9.10.0.35 and configured a System DSN that I verified with ODBC query tool.

Any attempt to open a free table (ADT or CDX) through UniDAC component TUniQuery fails with an error.

Any clues?

Thank you in advance.

Regards,
Alvaro Dalloz
http://www.dalloz.es

Re: Error when connecting to Advantage Tables

Posted: Fri 15 Mar 2013 10:13
by AlexP
Hello,

To connect to local Advantage tables, the ServerTypes property should be set to ALS. The following sample demonstrates connecting to an ADS test database distributed along with ODBC driver

Code: Select all

var
  UniConnection: TUniConnection;
  UniQuery: TUniQuery;
begin
  UniConnection := TUniConnection.Create(nil);
  try
    UniConnection.ProviderName := 'Advantage';
    UniConnection.SpecificOptions.Values['ServerTypes'] := 'ALS';
    UniConnection.Database := 'C:\Program Files\Advantage 9.10\Help\ADS_DATA\';
    UniConnection.Connect;
    UniQuery :=  TUniQuery.Create(nil);
    try
      UniQuery.Connection := UniConnection;
      UniQuery.SQL.Text := 'select * from animals';
      UniQuery.Open;
    finally
      UniQuery.Free;
    end;
  finally
    UniConnection.Free;
  end;

end;

Re: Error when connecting to Advantage Tables

Posted: Fri 15 Mar 2013 13:00
by rockbone
Hi Alex,

Thank you very much for your help!

The problem was that DSN parameters were overridden by Uniconnection properties. It was driving me crazy ...

;)

I see more clearly now ...

1. The Uniconnection.Database property must contain the ODBC connection string, including specific parameters (DefaultType required when opening free tables)

2. The UniConnection.SpecificOptions.Values['ServerTypes'] must be set to ALS

No need to configure any DSN ...

Great product Unidac. Congrats!

Kind regards,
Alvaro

Re: Error when connecting to Advantage Tables

Posted: Mon 18 Mar 2013 11:31
by AlexP
Hello,

If you want to use a set DSN, you should use ODBCUniProvider, and all the parameters, except user name and password, should be set in the DSN settings. If you use AdvantageUniProvider (without DSN), the connection parameters are set in theTUniConnection properties.

Re: Error when connecting to Advantage Tables

Posted: Wed 12 Jul 2017 18:09
by edmarfrazao
I had problems and I'm posting the correct solution

In the database you must pass the paramenter

UniConnection.SpecificOptions.Values['ServerTypes'] := 'ALS';
UniConnection.Database := 'C:\Program Files\Advantage 9.10\Help\ADS_DATA\ ; DefaultType=FoxPro';

or visite http://devzone.advantagedatabase.com/dz ... e_keys.htm