Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread dynamic creation of table
Tue, May 23 2017 10:21 PMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I have code dynamically creating a session component, database component and then a table.  When I open the table I get an error "Elevate Error #409 The configuration path is empty"
 
 EDBSession0 := TEDBSession.Create(nil);
 EDBSession0.AutoSessionName := True;
 EDBSession0.SessionDescription := sTemp;
 EDBDatabase0 := TEDBDatabase.Create(nil);
 EDBDatabase0.DatabaseName := 'Common0';
 EDBSession0.SessionType := stRemote;
 EDBSession0.RemoteAddress := '10.10.10.2';
 EDBSession0.LoginUser := 'Administrator';
 EDBSession0.LoginPassword := 'EDBDefault';
 EDBDatabase0.Database := 'HRBL';
 EDBSession0.Connected := True;

 tblEventLog_ := TEDBTable.Create(nil);
 tblEventLog_.DatabaseName := EDBDatabase0.DatabaseName;
 tblEventLog_.TableName := 'Event Log';
 tblEventLog_.Open;

What am I missing?
Tue, May 23 2017 11:38 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/23/2017 10:21 PM, gbh100 wrote:
> I have code dynamically creating a session component, database component and then a table.  When I open the table I get an error "Elevate Error #409 The configuration path is empty"
>   tblEventLog_ := TEDBTable.Create(nil);
>   tblEventLog_.DatabaseName := EDBDatabase0.DatabaseName;
>   tblEventLog_.TableName := 'Event Log';
>   tblEventLog_.Open;
>
> What am I missing?

I think you need to set both SessionName AND DatabaseName for the table
- otherwise i think it still defaults to local engine and tries to activate.

Raul

Wed, May 24 2017 7:03 AMPermanent Link

Adam Brett

Orixa Systems

gbh100

I tend to always add a "local config path", even for remote sessions:

Session1.LocalConfigPath:= '\\Somepath\data';

I am never sure whether it is needed or not ... but in certain situations I get the error message you have received if I do not set it.
Wed, May 24 2017 8:04 AMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I found my answer.  I never had tried an example with the sessionname set in both the database and the table components.  I had assumed that it was required in the database but not the table as it would get the session from the database.  Once I set the sessionname in both it works fine.  One or the other is not enough however.
Wed, May 24 2017 12:45 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< I found my answer.  I never had tried an example with the sessionname set in both the database and the table components.  I had assumed that it was required in the database but not the table as it would get the session from the database.  Once I set the sessionname in both it works fine.  One or the other is not enough however. >>

Unfortunately, this is legacy stuff from both DBISAM and the BDE that we kept in EDB and should have stripped out in favor of just straight component references.  It's also a real pain for multi-threading and causes all kinds of performance headaches because the session names need to be constantly "looked up", and the lookups need to be protected with critical sections/read-write locks.  We'll probably strip this out at some point in the future, but with plenty of advance notice and tools for converting your source code.

Tim Young
Elevate Software
www.elevatesoft.com
Image