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
Error when connecting to Advantage Tables
Re: Error when connecting to Advantage Tables
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
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
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
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
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.
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.
-
- Posts: 15
- Joined: Mon 23 Sep 2013 16:34
Re: Error when connecting to Advantage Tables
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
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