Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Pack an ADS Table with FDADSUtility shows Error 5159


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Last Post: Mar 21, 2017 10:11 PM Last Post By: Dmitry Arefiev
Joachim Breuer

Posts: 14
Registered: 4/10/03
Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 15, 2017 8:11 AM
I am trying to pack an ADS table which is a dictionary table with FDADSUtility. But I am always getting this error:

[FireDAC] [Phys] [ADS] Error 5159: Error encountered when trying to open a database table. The table is a database table. It cannot be opened as free table

I use Delphi Berlin Update 2 and Advantage Database Server 12.

Probably there is a setting which i don't set the right way.

procedure TForm1.Button1Click(Sender: TObject);
begin
  FDPhysADSDriverLink1.DateFormat := 'DD.MM.YYYY';
  FDPhysADSDriverLink1.DefaultPath := 'S:\MyDB';
 
  FDADSUtility1.DriverLink := FDPhysADSDriverLink1;
  FDADSUtility1.Database := 'S:\MyDB\MyDictionary.add;ServerTypes=Remote';
  FDADSUtility1.UserName := 'adssys';
  FDADSUtility1.TableType := ttADT;
 
  FDADSUtility1.Tables.Add('MyTable');
  FDADSUtility1.Pack;
end;

Doing this with the ADS components works:

procedure TForm1.Button2Click(Sender: TObject);
begin
  AdsConnection1.ConnectPath := 'S:\MyDB\MyDictionary.add';
  AdsConnection1.AdsServerTypes := [stADS_REMOTE];
  AdsConnection1.LoginPrompt := False;
  AdsConnection1.Username := 'adssys';
 
  AdsConnection1.Connect;
 
  AdsTable1.AdsConnection := AdsConnection1;
  AdsTable1.TableName := 'MyTable';
  AdsTable1.Exclusive := True;
 
  AdsTable1.Open;
 
  AdsTable1.AdsPackTable;
 
  AdsTable1.Close;
  AdsConnection1.Disconnect;
end;
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 19, 2017 11:30 PM   in response to: Joachim Breuer in response to: Joachim Breuer
FDADSUtility1.Database := 'S:\MyDB\MyDictionary.add;ServerTypes=Remote';

Try to use Database = '//<host>/<path>/MyDictionary.add'

--
With best regards,
Dmitry
Joachim Breuer

Posts: 14
Registered: 4/10/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 1:21 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Thanks for reply,
but using unc makes no difference ("S:\" is a local drive).
  FDADSUtility1.Database := '\\MyComputer\s$\MyDB\MyDictionary.add;ServerTypes=Remote';

Do I only need this 2 components (TFDPhysADSDriverLink and TFDADSUtility), no TFDConnection?


Dmitry Arefiev wrote:
FDADSUtility1.Database := 'S:\MyDB\MyDictionary.add;ServerTypes=Remote';

Try to use Database = '//<host>/<path>/MyDictionary.add'

--
With best regards,
Dmitry
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 5:31 AM   in response to: Joachim Breuer in response to: Joachim Breuer
Before filing a bug, could you please explain in mode details your environment.

--
With best regards,
Dmitry
Joachim Breuer

Posts: 14
Registered: 4/10/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 6:24 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
ADS Server: 12.0.0.0
ace32.dll: 12.0.0.1
Win10 Pro 64Bit
Delphi 10.1 Berlin Version 24.0.25048.9432

Dmitry Arefiev wrote:
Before filing a bug, could you please explain in mode details your environment.

--
With best regards,
Dmitry
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 6:37 AM   in response to: Joachim Breuer in response to: Joachim Breuer
And you use dictionary based tables with the server running locally ?

--
With best regards,
Dmitry
Joachim Breuer

Posts: 14
Registered: 4/10/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 8:38 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Yes, the server is running locally at my developing machine, but you don't need the server, you can also use the "ServeryType=Local" and get the same error 5159.

MyTable is a database table and it seems that TFDADSUtility likes to open the table as a free table and not as a database table.

Dmitry Arefiev wrote:
And you use dictionary based tables with the server running locally ?

--
With best regards,
Dmitry
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Pack an ADS Table with FDADSUtility shows Error 5159  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 10:11 PM   in response to: Joachim Breuer in response to: Joachim Breuer
Ok ... Looks like a bug. Could you please report it to qp.embarcadero.com

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02