Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread table or query active status
Mon, Feb 12 2018 2:07 PMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I am having some trouble understanding a good procedure to manage the active property of tables and queries in my Delphi applications.

I started by using the BeforeConnect event in the Session or Database but found had issues with it.  It has been a while so I can't elaborate on the issues and it is entirely possible it was all me.

Lately I have been setting my database and session properties in the OnCreate event of the DataModule or Form they reside in.  I have been using an Engine component to globally set them all inactive before building a new version of the application (when I remember).

I have history with ADS and am used to using a StoreActive property of a Table or Query so that once that property was set to False the VCL status of the active property didn't matter.

What does everyone do with EDB?  What is a good process to accomplish these goals.
Mon, Feb 12 2018 3:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< I have history with ADS and am used to using a StoreActive property of a Table or Query so that once that property was set to False the VCL status of the active property didn't matter.

What does everyone do with EDB?  What is a good process to accomplish these goals.
>>

What you want is the TEDBEngine.StoreActive property:

https://www.elevatesoft.com/manual?action=viewprop&id=edb2&product=rsdelphiwin32&version=10T&comp=TEDBEngine&prop=StoreActive

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Feb 13 2018 3:15 PMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I assume this only works if I drop an engine component on a form somewhere in the project or could I put a statement for the engine somewhere in the application to set that property?
Wed, Feb 14 2018 1:26 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

gbh100


I just use GExperts to set all the table, query, database, session, engine components to non-active. Been doing it for years, started back with DBISAM - works a treat.

Roy Lambert
Thu, Feb 15 2018 12:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< I assume this only works if I drop an engine component on a form somewhere in the project >>

That's correct - it has to be present at design-time in order to do what you want.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Feb 16 2018 4:35 PMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I've been using the engine component for a few days now and it works great!!  Thanks
Thu, Feb 22 2018 3:19 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< I've been using the engine component for a few days now and it works great!!  Thanks
>>

I'm glad that it's working for you.

One caveat that I forgot to mention:

If you're using the engine component in an environment that needs to be accessed in a multi-threaded manner, such as with a web module (DLL), then make sure that you perform such setup only once during the initialization of the module.  You can do this in the initialization section of the main unit for the module like this:

initialization
  with edbcomps.Engine do
     begin
     CharacterSet:=csAnsi;
     TempTablesPath:=OSTempDirectory;
     UseLocalSessionEngineSettings:=True;
     Active:=True;
     end;
end.

Unfortunately, that also means that you cannot place the TEDBEngine component directly on the web module, also.  If you do so, you risk causing a race condition.  It's not that big of a deal for the StoreActive property because it's a Boolean, but you can run into more serious issues when configuring other engine properties that way.

Tim Young
Elevate Software
www.elevatesoft.com
Image