Connect to ADS database using an alias

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
shsit
Posts: 21
Joined: Thu 05 Oct 2006 11:41

Connect to ADS database using an alias

Post by shsit » Mon 10 Jan 2011 14:59

Hi,

I'm using unidac to connect to an advantage database server.
When I specify a full path to the database (like "C:\DB\database.ADD") it works fine, but when I use the alias (which is defined in the ads.ini) I can connect to the database, but I can't open any table (table not found).

How can I connect to the database using the alias?
Thanks!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 11 Jan 2011 13:11

Hello,

Please specify your alias settings (ads.ini) so that I am able to reproduce the problem.

shsit
Posts: 21
Joined: Thu 05 Oct 2006 11:41

Post by shsit » Wed 26 Jan 2011 08:43

Hello again,

sorry for my late respone, I've been in hollidays the last weeks.

Here's a piece of my ads.ini:

Code: Select all

[Databases]
MYDB1=\pc173\db\db1\db1.add;D
MYDB2=\pc173\db\db2\db2.add;D

[Settings]
ADS_SERVER_TYPE=7
Thanks for your help.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 26 Jan 2011 13:23

Hello,

Thank you for the information.
We have reproduced the problem.
Unfortunately, now UniDAC really does not support working with Advantage using ads.ini.
We will investigate the possibility of adding this feature in one of the next versions.

shsit
Posts: 21
Joined: Thu 05 Oct 2006 11:41

Post by shsit » Wed 26 Jan 2011 13:58

Hi, thanks for confirming this.
It would be nice if this feature is integrated in a future release.
For now, I simply solve it this way:

Code: Select all

procedure TdmMain.UniConnection1BeforeConnect(Sender: TObject);
var
  ini : TIniFile;
  dbPath : String;
begin
  ini := TIniFile.Create('c:\path-to\ads.ini');
  dbPath := ini.ReadString('Databases','DB1','');
  UniConnection1.Database := LeftStr(dbPath, Pos(';',dbPath)-1);
end;

Post Reply