ElevateDB XDATA Server Database name already exists

I'm just starting out with XData and trying to connect to an ElevateDB database.

I can use the browser to see the list of tables http://localhost:2001/tms/xdata

But get an error that the databasename already existing when accessing the table http://localhost:2001/tms/xdata/Customers

{
"error": {
"code": "DatabaseError",
"message": "Database name 'TestDB' already exists"
}
}

I tried the code referenced in ElevateDB and RemoteDB (Aurelius) as below

procedure TDataModule1.EDBDatabase1BeforeConnect(Sender: TObject);
begin
if EDBDatabase1.DatabaseName = ‘’ then
EDBDatabase1.DatabaseName := IntToStr(NativeInt(EDBDatabase1));
end;

But this only allows me to see the results once, clicking refresh in the browser generates the same message that the database already exists

Are you using TAureliusConnection and TXDataConnectionPool components? How is your TXDataServer configured, exactly?

I Just used the XDATA Wizard and added a EDBSession and ESBDatabase components and linked to the AueliusConnection.

If I run the same wizard and add a MSSQL via FireDac it works as expected

Can you please provide the source code so we know what we are talking about?

Thank you for the project (sent in a private message). Please try the following code in the event:

procedure TServerContainer.EDBDatabase1BeforeConnect(Sender: TObject);
var
  DB: TEDBDatabase;
begin
  DB := TEDBDatabase(Sender);
  if DB.DatabaseName = '' then
    DB.DatabaseName := IntToStr(NativeInt(DB));
end;

I can confirm that that code has worked.

Many thanks,

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.