Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Making EDB portable
Fri, Mar 9 2012 8:18 AMPermanent Link

Adam Brett

Orixa Systems

I am making a trial version of my product which will be run off a memory stick.

As I don't know the device path prior to running the EXE I need to set the Session.ConfigPath & Database PATH at run-time. This part is not too hard, I just have a method to set everything up in my own descendent of TEDBDatabase:

 DatabaseName:= aDBName;
 Database:= aDBName;
 Sess:= TEDBSession.Create(self);
 Sess.LoginUser:= 'Administrator';
 Sess.LoginPassword:= aPassword;
 Sess.SessionName:= aSessionName;
 Sess.SessionType:= stLocal;
 Sess.LocalConfigPath:= GetDriveOrDir+'\Data';
 FEngine:= TEDBEngine.Create(self);
 FEngine.Name:= 'EDBEngine';
 FEngine.ConfigPath:= Sess.LocalConfigPath;
 SessionName:= Sess.SessionName;
 aSQLStr:= FORMAT(' ALTER DATABASE "%s" PATH ''%s'' ',
                  [DatabaseName,
                   Sess.LocalConfigPath+'\Data']);
 Sess.Execute(aSQLStr);
 Connected:= True;

This all works fine. However, my DB uses an external module. When I test-run the system on my own PC it works fine, but when I install on other computers I get the message "error 203 ... module XXXX not found".

I have tried adding the following code to the above method:

 try
   aSQLStr:= FORMAT(' CREATE MODULE "UIDModule" PATH ''%s\UIDModule.dll'' ',
                    [Sess.LocalConfigPath]);
   Sess.Execute(aSQLStr);
 except
 end;

But this also returns an error.

Is it possible to have a "portable" EDB Database app which uses external modules?
What am I doing wrong?
Fri, Mar 9 2012 9:47 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


I think your problem is that the module is already there. Try DROPing it first then creating it. Or better still, having just had a quick shuftie at the help, ALTER MODULE.

Roy Lambert [Team Elevate]
Fri, Mar 9 2012 11:03 AMPermanent Link

Adam Brett

Orixa Systems

>>ALTER MODULE.

... sorry ... stupid of me. Of course, the module already exists in the Config file, but is defined there with a PATH which will have changed for a new local version of the database.

Might be nice to be able to make PATHs relative, so you could have a PATH in the form '..\Modules\<modulename>' which was understood by the engine, so this type of problem did not occur.
Wed, Mar 21 2012 4:14 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< Might be nice to be able to make PATHs relative, so you could have a PATH
in the form '..\Modules\<modulename>' which was understood by the engine, so
this type of problem did not occur. >>

You can:  databases, stores, and modules all work with relative paths
("relative" being relative to the configuration file path).

--
Tim Young
Elevate Software
www.elevatesoft.com
Image