Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 3 of 3 total |
EDB - databaselocation from ini |
Wed, Oct 17 2007 4:18 AM | Permanent Link |
"Harry de Boer" | LS,
I am rewriting a dbisam based middleware server to an edb based one. At middlewareserver startup a couple of settings are read from an ini file. I have an ini setting: [database] path= so after installing the dbisam files to a directory I change the path in the ini file to that directory. What's the easiest/best way to do this with EDB (local) -data and middlewareserver are on the same machine? Regards, Harry |
Wed, Oct 17 2007 7:28 AM | Permanent Link |
"Harry de Boer" | Think I got it.
-Copy the data to a directory -Set the path in the inifile -In middleware code that the DATABASE is CREATED Regards Harry "Harry de Boer" <harry@staaf.nl> schreef in bericht news:CD2C55D4-F8D4-4977-9A88-74633EA37966@news.elevatesoft.com... > LS, > > I am rewriting a dbisam based middleware server to an edb based one. At > middlewareserver startup a couple of settings are read from an ini file. I > have an ini setting: > [database] > path= > so after installing the dbisam files to a directory I change the path in the > ini file to that directory. > > What's the easiest/best way to do this with EDB (local) -data and > middlewareserver are on the same machine? > > Regards, Harry > > |
Thu, Oct 18 2007 2:22 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Harry,
<< -Copy the data to a directory -Set the path in the inifile -In middleware code that the DATABASE is CREATED >> Yep, you can find code on checking the Configuration database for the existence of a database and creating it, if necessary, in the CDCollector example application that comes with EDB. It's in the data module code: procedure TCDCollectorDataModule.DataModuleCreate(Sender: TObject); begin { Activate the engine. The engine can also be referenced by the generic Engine variable in the edbcomps unit } CDCollectorEngine.Active:=True; { Now connect the session } CDCollectorSession.Connected:=True; { Check to see if the database exists or whether it needs to be created } with ConfigurationQuery do begin SQL.Text:='SELECT * FROM Databases WHERE Name='+Engine.QuotedSQLStr('CDCollector'); Open; if (RecordCount=0) then begin { Database doesn't exist and we need to create it } Close; SQL.Text:='CREATE DATABASE "CDCollector" PATH '+ Engine.QuotedSQLStr(ExtractFilePath(Application.ExeName)+'data'); ExecSQL; end else Close; end; -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |