Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
Anyone using TMS Aurelius with EDB? I have a stupid newbie problem. |
Mon, Jul 24 2023 3:33 PM | Permanent Link |
Adam Brett Orixa Systems | I have set up a TMS RemoteDB Server program.
In the data module of this program I have EDBDatabase, EDBSession and (for testing) a EDBQuery. It contains a TMS AureliusConnection with "AdapterName" = ElevateDB and "SQLDialect" = ElevateDB, "AdaptedConnection" = EDBDatabase1 ... other components are on the server data module as per TMS examples. The EDBQuery CAN be opened with a simple SQL Statement, the session & database are both Connected at design time, so I can clearly see that all the EDB side of things works well. When I run the Server, and then write a Client when I try to connect to the server, it fails with the message "DatabaseName <my database name> already exists." I think TMS must be doing something funny behind the scenes. Any ideas how I can fix this? |
Mon, Jul 24 2023 3:57 PM | Permanent Link |
Mike | Hi Adam,
Try to use a different approach to create an unique name for the database. For example: var _Counter_: Integer; procedure TDataModule1.EDBDatabase1BeforeConnect(Sender: TObject); var DB: TEDBDatabase; begin DB := Sender as TEDBDatabase; if DB.DatabaseName = ‘’ then begin DB.DatabaseName := IntToStr(_Counter_); AtomicIncrement(_Counter_); end; end; … initialization _Counter_ := 1; Greetings, Michael |
Mon, Jul 24 2023 4:40 PM | Permanent Link |
Adam Brett Orixa Systems | Hi Mike.
Thanks for this, I saw this solution suggested on the TMS website. I have no idea why, but it doesn't work for me. I used the following: function TServerContainer.DBName: String; begin INC(iDBName); Result := 'DB' + IntToStr(iDBName); end; procedure TServerContainer.EDBDatabase1BeforeConnect(Sender: TObject); begin if EDBDatabase1.DatabaseName = '' then EDBDatabase1.DatabaseName := DBName; end; Which I think does the same thing. In my Server App the EDB Database and Session are not connected at design-time. So I guess the AureliusConnection is calling "Connect" on them at run-time. I get the error: --------------------------- RemoteDB request error: http://localhost:80/test/config 500 Exception Class: EDatabaseError Message: Database name 'DB1' already exists. --------------------------- OK --------------------------- I am using EDB 27.1, the current version of Aurelius and Delphi 11.3 I am really confused, as I figured it would be pretty straightforward to set up the basic connection. |
Thu, Jul 27 2023 5:59 AM | Permanent Link |
Mike | Try this instead.
Database := TEDBDatabase.Create(nil); with Database do begin Database := 'MTS'; if DatabaseName = '' then DatabaseName := IntToStr(NativeInt(Database)); KeepConnection := True; end; Database.SessionName := Session.SessionName; Database.Connected := True; |
Thu, Jul 27 2023 10:01 AM | Permanent Link |
Adam Brett Orixa Systems | Thanks Mike. I got it working.
I don't think too many people are using EDB and Aurelius ... but is seems a good solution. I would be curious to have a chat about how you use it what you do etc., totally understand if you don't have time. If you are interested, email me at adam <at sign> orixa.co.uk Thanks. |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |