Page 1 of 1
Connect to ADS database using an alias
Posted: Mon 10 Jan 2011 14:59
by shsit
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!
Posted: Tue 11 Jan 2011 13:11
by AlexP
Hello,
Please specify your alias settings (ads.ini) so that I am able to reproduce the problem.
Posted: Wed 26 Jan 2011 08:43
by shsit
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.
Posted: Wed 26 Jan 2011 13:23
by AlexP
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.
Posted: Wed 26 Jan 2011 13:58
by shsit
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;