Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Moving a database
Tue, Oct 2 2007 1:32 PMPermanent Link

revort
I've  developed a small application and now need to move the database out to the network and allow users to connect to it.
How do I change the databasebase path in the configuration files and how do I get all my users setup to connect to the new location.
Is DBISAM I would just read the path from the registry and be off and running, do ElevateDB work in the same manner.
Thanks
Tue, Oct 2 2007 2:27 PMPermanent Link

Abdulaziz Jasser
revort,

This is what I do:

.................................................................................
var
      sDirectory : String; //This one has the path read from the registry.
      qryConfig : TEDBQuery;
begin
      qryConfig := TEDBQuery.Create(Application);

      //Read the configuration file and look for a DB called "MyDatabase".
      EDBSession1.Execute(Format('SELECT * FROM DATABASES WHERE Name = %s',[QuotedStr
('MyDatabase')]),Nil,qryConfig);
      
      //If "MyDatabase" is not there, then create one.
      if qryConfig.RecordCount = 0 then begin
         dmAccount.EDBSession1.Execute(Format('CREATE DATABASE "MyDatabase" PATH %s',
[QuotedStr(sDirectory)]));
      end else begin
         //If path of "MyDatabase" does not match the one read from the registry then
drop it and recreate it with the new path.
         if qryConfig['Path'] <> sDirectory then begin
            dmAccount.EDBSession1.Execute('DROP DATABASE "MyDatabase" KEEP CONTENTS');
            dmAccount.EDBSession1.Execute(Format('CREATE DATABASE "MyDatabase" PATH %s',
[QuotedStr(sDirectory)]));
         end;
      end;





Also check this link:

http://www.elevatesoft.com/scripts/newsgrp.dll?action=openmsg&group=16&msg=2326&page=5
Image