Hello,
on my DA Server I have sucessfully configured 2 connections, used for 2 different DB, Firebird and Oracle databases.
I have imported into the Schema few tables from both sources,
I can see data preview from FB, but on the Oracle tables I get always a DlgError: "Error while executing SQL: not logged on."
I do not understand why, because the TestConnection is successful and I also get from oracle the table list…
The connection string is:
DOA?Server=localhost;Database=//10.236.20.142:1521/xe;UserID=MARCO;Password=passpartout;Pooling=false;
manually change connection name at server-side like:
procedure TGeneratorsSample_Service.DataAbstractServiceValidateDatasetAccess(
Sender: TObject; const aConnection: IDAConnection;
const aDatasetName: String; const aParamNames: array of String;
const aParamValues: array of Variant; aSchema: TDASchema;
var Allowed: Boolean);
var
i: integer;
ConName: string;
begin
ConName := '';
for i := 0 to aSchema.Datasets.Count - 1 do
if AnsiSameText(aSchema.Datasets[i].Name, aDatasetName) then begin
ConName := aSchema.Datasets[i].Statements[0].Connection;
break;
end;
if not AnsiSameText(ConName, aConnection.Name) then begin
Connection := aSchema.ConnectionManager.NewConnection(ConName);
for i := 0 to aSchema.ConnectionManager.Connections.Count - 1 do
aSchema.ConnectionManager.Connections[i].Default :=
AnsiSameText(aSchema.ConnectionManager.Connections[i].Name, ConName);
end;
end;
I’ll try your suggested steps in code, but why it doesn’t work on SchemaModeler ?
I omitted to try anything in code, because if already DASM cannot show data preview,
the problem shouldn’t be in client side…
In your tests with DASM do you see preview of data on both DB/tables ?
DASM has some tweaks for showing data from different connections.
Unfortunately, DAServer can work only with one connection object at once
for working with tables from different databases we have introduced TDAHETConnection feature.
I have changed the Oracle driver to Oracle.NET and now I can see the data preview in both DB !
Probably there is lack in the DOA driver, I guess.
Anyway on Client side I can “Get design-time data” only on a single connection;
I think this confirm what you said about the limit of one connection object only for DAServers.
It is a strange logic for me, because I expect that a Client of a 3-tier framework should be able to deal with published objects (tables) without worry about their original DbConnection…
So I suppose is not possible also create Unions with fields of tables from different connections ?